[MDEV-492] Assertion `! is_set()' failed in Diagnostics_area::set_ok_status on UPDATE with dynamic column functions in WHERE Created: 2012-08-26  Updated: 2012-08-30  Resolved: 2012-08-30

Status: Closed
Project: MariaDB Server
Component/s: None
Affects Version/s: 5.5.25, 5.3.7
Fix Version/s: 5.5.28, 5.3.9

Type: Bug Priority: Major
Reporter: Elena Stepanova Assignee: Oleksandr Byelkin
Resolution: Fixed Votes: 0
Labels: None


 Description   

mysqld: maria-5.5/sql/sql_error.cc:358: void Diagnostics_area::set_ok_status(THD*, ulonglong, ulonglong, const char*): Assertion `! is_set()' failed.
[ERROR] mysqld got signal 6 ;

#3  0x083ceadc in handle_fatal_signal (sig=6)
    at sql/signal_handler.cc:262
#4  <signal handler called>
#5  0xffffe430 in __kernel_vsyscall ()
#6  0xb74497af in raise () from /lib/libc.so.6
#7  0xb744b0f0 in abort () from /lib/libc.so.6
#8  0xb7442014 in __assert_fail () from /lib/libc.so.6
#9  0x0821b845 in Diagnostics_area::set_ok_status (this=0x966f644, thd=0x966d4b0,
    affected_rows_arg=0, last_insert_id_arg=0,
    message_arg=0xad0b0508 "Rows matched: 0  Changed: 0  Warnings: 1")
    at sql/sql_error.cc:358
#10 0x081dc5b1 in my_ok (thd=0x966d4b0, affected_rows=0, id=0,
    message=0xad0b0508 "Rows matched: 0  Changed: 0  Warnings: 1")
    at sql/sql_class.h:3130
#11 0x082e17ac in mysql_update (thd=0x966d4b0, table_list=0x971d400, fields=...,
    values=..., conds=0x0, order_num=0, order=0x0, limit=18446744073709551615,
    handle_duplicates=DUP_ERROR, ignore=false, found_return=0xad0b0b50,
    updated_return=0xad0b0b48) at sql/sql_update.cc:937
#12 0x0823d945 in mysql_execute_command (thd=0x966d4b0)
    at sql/sql_parse.cc:2797
#13 0x082458c9 in mysql_parse (thd=0x966d4b0,
    rawbuf=0x971d2c0 "UPDATE t1 SET a = 'new'\nWHERE COLUMN_GET( COLUMN_CREATE( 1, 'v', 1, 'w' ), 2 AS CHAR ) IS NULL OR 1", length=99, parser_state=0xad0b0da4)
    at sql/sql_parse.cc:5736
#14 0x08239d14 in dispatch_command (command=COM_QUERY, thd=0x966d4b0,
    packet=0x9717469 "UPDATE t1 SET a = 'new'\nWHERE COLUMN_GET( COLUMN_CREATE( 1, 'v', 1, 'w' ), 2 AS CHAR ) IS NULL OR 1 ", packet_length=100)
    at sql/sql_parse.cc:1055
#15 0x082391d9 in do_command (thd=0x966d4b0) at sql/sql_parse.cc:794
#16 0x083253cd in do_handle_one_connection (thd_arg=0x966d4b0)
    at sql/sql_connect.cc:1253
#17 0x08324f18 in handle_one_connection (arg=0x966d4b0)
    at sql/sql_connect.cc:1168
#18 0x0854fc9b in pfs_spawn_thread (arg=0x975c640)
    at storage/perfschema/pfs.cc:1015
#19 0xb7721b25 in start_thread () from /lib/libpthread.so.0

Some pointers may be invalid and cause the dump to abort.
Query (0x971d2c0): UPDATE t1 SET a = 'new' WHERE COLUMN_GET( COLUMN_CREATE( 1, 'v', 1, 'w' ), 2 AS CHAR ) IS NULL OR 1
Connection ID (thread ID): 2
Status: NOT_KILLED

bzr version-info
revision-id: knielsen@knielsen-hq.org-20120824132901-h62tb4n77ffj9shb
date: 2012-08-24 15:29:01 +0200
build-date: 2012-08-27 00:30:01 +0400
revno: 3508

Also reproducible on maria/5.3 revno 3564.
Reproducible with MyISAM, Aria, InnoDB.

CREATE TABLE t1 (a CHAR(3), b BLOB);
 
UPDATE t1 SET a = 'new'
WHERE COLUMN_GET( COLUMN_CREATE( 1, 'v', 1, 'w' ), 2 AS CHAR ) IS NULL OR 1 ;



 Comments   
Comment by Oleksandr Byelkin [ 2012-08-27 ]

Here is shorter test suite:

UPDATE t1 SET a = 'new'
WHERE COLUMN_CREATE( 1, 'v', 1, 'w' ) IS NULL OR 1 ;

The problem is that error from COLUMN_CREATE somehow get masked...

Comment by Oleksandr Byelkin [ 2012-08-27 ]

It is incorrect error check before sending OK in mysql_update

Comment by Sergei Golubchik [ 2012-08-28 ]

here's even shorter: UPDATE t1 SET a = 'new' WHERE COLUMN_CREATE( 1, 'v', 1, 'w' );

Comment by Oleksandr Byelkin [ 2012-08-29 ]

Pushed. Waiting for buildbot...

Comment by Oleksandr Byelkin [ 2012-08-30 ]

Buildbot was OK

Generated at Thu Feb 08 06:29:09 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.