Details
-
Type:
Bug
-
Status: Closed
-
Priority:
Minor
-
Resolution: Not a Bug
-
Affects Version/s: 5.1.67, 5.2.14, 5.3.12, 5.5.34, 10.0.7
-
Fix Version/s: None
-
Component/s: None
-
Labels:
Description
I found this bug adding \W at the beginning of a batch file, but I can write a command-line test case:
MariaDB [stk_apalog]> \W
Show warnings enabled.
MariaDB [stk_apalog]> DELIMITER ||
MariaDB [stk_apalog]> CREATE DATABASE IF NOT EXISTS test;
-> DO NULL;
-> ||
Query OK, 1 row affected, 1 warning (0.00 sec)
Query OK, 0 rows affected (0.00 sec)
The || delimiter runs 2 statements in this case. If the first statement generates a warning, the warning does not appear. By deleting USE NULL and retrying, the warning appears.
Gliffy Diagrams
Attachments
Activity
- All
- Comments
- Work Log
- History
- Activity
- Transitions
I actually see some logic in the current behavior.
\W is a client option that means "Enable display of warnings after each statement"
DELIMITER means a separator between statements from the client's point of view.
Thus, after we set it to a non-';' value, for the client the whole composition of CREATE and DO is a single statement; and when it's fully executed, it produces no warnings.
However, I"m not sure if it's designed this way or I'm just inventing excuses, so I'll leave it to somebody else to decide.