You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "eldenmoon (via GitHub)" <gi...@apache.org> on 2024/10/28 04:35:09 UTC
[I] [Enhancement] audit log print real sql in prepared statement [doris]
eldenmoon opened a new issue, #42553:
URL: https://github.com/apache/doris/issues/42553
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/doris/issues?q=is%3Aissue) and found no similar issues.
### Description
_No response_
### Solution
_No response_
### Are you willing to submit PR?
- [ ] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [I] [Enhancement] audit log print real sql in prepared statement [doris]
Posted by "HexyinUESTC (via GitHub)" <gi...@apache.org>.
HexyinUESTC commented on issue #42553:
URL: https://github.com/apache/doris/issues/42553#issuecomment-2447682256
Should I add corresponding unit tests? I haven't found unit tests for this class. Or is it sufficient to just pass the regression tests?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [I] [Enhancement] audit log print real sql in prepared statement [doris]
Posted by "eldenmoon (via GitHub)" <gi...@apache.org>.
eldenmoon commented on issue #42553:
URL: https://github.com/apache/doris/issues/42553#issuecomment-2449005039
You could continue the second problem in this issue too, they are related issues for improving prepared statement observation
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [I] [Enhancement] audit log print real sql in prepared statement [doris]
Posted by "eldenmoon (via GitHub)" <gi...@apache.org>.
eldenmoon commented on issue #42553:
URL: https://github.com/apache/doris/issues/42553#issuecomment-2448986495
greate job, almost done . Another improement
1. Add a flag in audit log to indicate whether it is a prepared command example add a field named `CommandType=COM_QUERY` , `CommandType=COM_STMT_PREPARE` to indicate the mysql command type(MysqlCommand.java).
2. As you can see in audit log, there are many duplicated log with the same QueryId it's maybe a bug fix it
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [I] [Enhancement] audit log print real sql in prepared statement [doris]
Posted by "eldenmoon (via GitHub)" <gi...@apache.org>.
eldenmoon commented on issue #42553:
URL: https://github.com/apache/doris/issues/42553#issuecomment-2440540538
notice use `./run-regression-test.sh --run -d prepared_stmt_p0` can reproduce the first issue when using session variable like` set global enable_prepared_stmt_audit_log = true;`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [I] [Enhancement] audit log print real sql in prepared statement [doris]
Posted by "HexyinUESTC (via GitHub)" <gi...@apache.org>.
HexyinUESTC commented on issue #42553:
URL: https://github.com/apache/doris/issues/42553#issuecomment-2448994042
Thank you for your reply.
1. It is easy to add this flag to all statements. I will complete this feature.
2. When I first reproduced the problem, I found that some SQL statements that should be recorded were not written to the audit, and some sentences are repeated many times. which confused me. However, I saw that the above task did not include this content, so I temporarily ignored this module. Should I open another issue to fix this?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [I] [Enhancement] audit log print real sql in prepared statement [doris]
Posted by "HexyinUESTC (via GitHub)" <gi...@apache.org>.
HexyinUESTC commented on issue #42553:
URL: https://github.com/apache/doris/issues/42553#issuecomment-2447635548
"I understand your point as follows:
1. After setting set global `enable_prepared_stmt_audit_log = true;`, we should use `select * from tbl where id = XXX` to replace `EXECUTE xxxx USING XXX`.
2. When `set global enable_prepared_stmt_audit_log = false;`(default), the state of the audit log should be OK upon prepared success. (Here, I noticed that after a successful execution, the state is explicitly set to NOOP, and I’m unsure if this is intentional.)
Is my understanding correct? Below is the version I implemented based on this understanding:"
1. before

after

2. before
```
State=NOOP|ErrorCode=0|ErrorMessage=|Time(ms)=0|ScanBytes=0|ScanRows=0|ReturnRows=0|StmtId=638|QueryId=***IsQuery=false|isNereids=true|feIp=******|StmtType=SELECT|Stmt=select * from tbl_prepared_stmt_in_list WHERE `k10` IN (?, ?, ?, ?, ?) order by 1|CpuTimeMS=0|
```
after
```
State=OK|ErrorCode=0|ErrorMessage=|Time(ms)=0|ScanBytes=0|ScanRows=0|ReturnRows=0|StmtId=319|QueryId=*****|IsQuery=false|isNereids=true|feIp=******|StmtType=SELECT|Stmt=select * from tbl_prepared_stmt_in_list WHERE `k10` IN (?, ?, ?, ?, ?) order by 1|CpuTimeMS=0|
```
Please let me know if I have misunderstood any part of this. Thank you.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [I] [Enhancement] audit log print real sql in prepared statement [doris]
Posted by "eldenmoon (via GitHub)" <gi...@apache.org>.
eldenmoon commented on issue #42553:
URL: https://github.com/apache/doris/issues/42553#issuecomment-2448989282
it's difficult to add such regression-test, so pass the tests should be ok
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [I] [Enhancement] audit log print real sql in prepared statement [doris]
Posted by "eldenmoon (via GitHub)" <gi...@apache.org>.
eldenmoon closed issue #42553: [Enhancement] audit log print real sql in prepared statement
URL: https://github.com/apache/doris/issues/42553
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org