[MDEV-6421] SQL_ERROR_LOG doesn't log comments in Events Created: 2014-07-06 Updated: 2021-09-08 Resolved: 2016-01-26 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Prepared Statements |
| Affects Version/s: | 10.0.12 |
| Fix Version/s: | 10.0.24, 10.1.12 |
| Type: | Bug | Priority: | Minor |
| Reporter: | Federico Razzoli | Assignee: | Alexey Botchkov |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | sql_error_log | ||
| Issue Links: |
|
||||||||
| Sprint: | 10.1.11 | ||||||||
| Description |
|
With the SQL error log enabled:
The statement is wrong, and is written into SQL_ERROR_LOG. But '/* e1 */' is not logged. The comment is preserved in the event source, though:
The reason why this is a problem, is that there is not easy way to see events errors. Logging these errors into the SQL_ERROR_LOG would be very useful, if we could filter the entries based on a comment. Without this ability, that log is probably too big. Alternative request: ability to write the scheduler's SQL errors into a separate log. Both solutions would be equally good from my point of view. |
| Comments |
| Comment by Elena Stepanova [ 2014-07-06 ] | ||||||
|
It looks like comments are not logged at all, not only in events:
log:
Not sure if it was intentional and if there was a good reason for that. Executable comments are logged, which of course is correct:
log:
| ||||||
| Comment by Federico Razzoli [ 2014-07-06 ] | ||||||
|
Elena, interestingly in my installation comments are logged:
But comments in events are not logged. | ||||||
| Comment by Elena Stepanova [ 2014-07-06 ] | ||||||
|
This is indeed interesting, I tried the release build 10.0.12 (from non-GLIBC_2_14 bintar), and I'm still not getting comments in the log. | ||||||
| Comment by Federico Razzoli [ 2014-07-06 ] | ||||||
|
I use that tar too. My OS is Debian. | ||||||
| Comment by Federico Razzoli [ 2014-07-06 ] | ||||||
|
Elena, please no offence if I'm wrong - did you start mysql with --comments option? I made this error: I just remembered | ||||||
| Comment by Elena Stepanova [ 2014-07-07 ] | ||||||
|
Oh no, you are right of course, thanks. I went through all thinkable server options, but totally forgot about the client ones. Sorry for the confusion, I've now retried with the option, reproducible as described. On the other hand, if you place the comment somewhere else, not at the end of the statement, it's logged:
So it might be an easy workaround. | ||||||
| Comment by Federico Razzoli [ 2014-07-08 ] | ||||||
|
From my tests, the comment is not logged if it is at the beginning or at the end of the statement, but seems to be logged if it is written anywhere else. Yes, it's a good workaround | ||||||
| Comment by Alexey Botchkov [ 2016-01-25 ] | ||||||
|
Fixing patch: | ||||||
| Comment by Alexey Botchkov [ 2016-01-26 ] | ||||||
|
Final fix: http://lists.askmonty.org/pipermail/commits/2016-January/008869.html |