[MDEV-7935] CREATE TABLE ... AS SELECT ... can cause a Server crash (Assertion `0' in Protocol::end_statement) Created: 2015-04-08 Updated: 2017-03-28 Resolved: 2015-05-02 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Data Definition - Alter Table |
| Affects Version/s: | 10.0.17 |
| Fix Version/s: | 10.0.18 |
| Type: | Bug | Priority: | Major |
| Reporter: | Olivier Bertrand | Assignee: | Olivier Bertrand |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | verified | ||
| Issue Links: |
|
||||||||
| Description |
|
For instance:
freezes the server (DEBUG version) with:
However, doing:
Just issue the expected message "Open error on e:/truc/foo.txt..." This may not be specific to the CONNECT engine. It seems that when the storage engine function write_row returns in error with rc= HA_ERR_INTERNAL_ERROR, the error return is handled correctly by MariaDB but in and only in the case of "CREATE TABLE ... AS SELECT ..." at the very end of the process, when the function Protocol::end_statement is called, the thd->get_stmt_da()->status() call returns an invalid value. Things are almost worst when using a RELEASE server because the DBUG_ASSERT not being executed, no error message is displayed but the table is silently not created. |
| Comments |
| Comment by Sergei Golubchik [ 2015-05-02 ] |
|
It's a bug in the connect engine. That's what's happening:
better not to reset thd status in the engine. |
| Comment by Olivier Bertrand [ 2015-05-02 ] |
|
Fixed by suppressing the resetting code. However, the issue is that this code was added because without it an assertion was raised in some cases. Unfortunately I can't remember what were these cases. Therefore fixing it in this case will perhaps make a new crash happening on another cases. Once more, this demonstrate the very bad use of assertion in case where a proper error message should be provided. |