[MDEV-4943] Error 1758 doesnt have a SQLSTATE? Created: 2013-08-24 Updated: 2022-09-12 Resolved: 2022-09-12 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | OTHER |
| Affects Version/s: | 10.0.4 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Minor |
| Reporter: | Federico Razzoli | Assignee: | Unassigned |
| Resolution: | Won't Fix | Votes: | 0 |
| Labels: | upstream | ||
| Description |
|
This is a MySQL bug, but as you know I prefer not to give lots of my personal data to Oracle. As far as I can tell, error 1758 seems to have not a SQLSTATE:
From the documentation, SQLSTATE should be '35000': This causes some trivial problems:
|
| Comments |
| Comment by Elena Stepanova [ 2013-08-26 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Hi Federico, Could you please help me understand how your example shows that there is no SQLSTATE for 1758? From what I see, it's there all right:
Reporting it as a warning rather than an error is apparently intentional, at least it's documented (http://dev.mysql.com/doc/refman/5.6/en/get-diagnostics.html): The fact that it's not handled by a handler is another story. I'd think it's not because of the SQLSTATE, it looks like the warning somehow gets lost (suppressed?) if it happens inside a procedure:
(no warning caused by the procedure call). I'm not quite sure if it's a bug or not (haven't found it in the documentation yet), if you think it is, we might try to create a bug report at Oracle and see what they say. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Federico Razzoli [ 2013-08-26 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
My hypotesys (no SQLSTATE) seems to be wrong, but what I find strange is that:
These facts surprised me, so I wanted to report that (in my opinion) there is something strange. If it isn't a bug, or you think it's totally unimportant, please ignore this report. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Elena Stepanova [ 2013-09-16 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Hi Federico, Sorry for the delay. MariaDB [test]> drop table if exists nonexisting; Note (Code 1051): Unknown table 'test.nonexisting' The warning of Level error does look weird, I asked for Serg's consult on this. If he reckons it to be a bug, we'll file it at MySQL and see what they say, and will proceed from there. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Elena Stepanova [ 2013-09-16 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Federico Razzoli [ 2014-06-24 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
My conclusion that it doesn't have an SQLSTATE was wrong. The problem was that I couldn't handle that error in any way. Here's the story of how I discovered this bug. I wrote a procedure to copy the diagnostics area into a table. There is no easy way to do this, so I loop through the conditions and used MYSQL_ERRNO, etc, to compose a prepared statement INSERT. In the initial version, I thought I could exit from the loop when this warning occurs (DECLARE HANDLER ... LEAVE `this_loop`), but this never happened. The workaround was easy. So... I guess it's up to you decide if this is a bug. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Federico Razzoli [ 2014-06-24 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Curiously, I've noted that this warning is written in the SQL_ERROR_LOG. But other warnings I tried are not logged. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Daniel Black [ 2017-12-30 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
FWIW - 10.3.4.
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Sergei Golubchik [ 2022-09-12 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
10.0 was EOLed in March 2019 |