Bug #85943 TABLE::setup_partial_update(): Assertion `m_partial_update_info == nullptr' fail
Submitted: 14 Apr 2017 5:51 Modified: 5 Jun 2017 12:40
Reporter: Viswanatham Gudipati Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Optimizer Severity:S3 (Non-critical)
Version:8.0.2 OS:Any
Assigned to: CPU Architecture:Any

[14 Apr 2017 5:51] Viswanatham Gudipati
Description:
This problem found while testing the wl#8960 , but it is not related the wl#8960 . It is related the optimizer wl#8963

mysqld.err:
-------------
Version: '8.0.2-dmr-debug-log'  socket: '/home/viswanatham/work/wl8960/mysql/mysql-test/var/tmp/mysqld.1.sock'  port: 13000  Source distribution
2017-04-14T05:27:08.381837Z 5 [ERROR] Invalid (old?) table or database name 'mysqld.1'
mysqld: /home/viswanatham/GIT-MySQL/mysql/sql/table.cc:7825: bool TABLE::setup_partial_update(): Assertion `m_partial_update_info == nullptr' failed.
05:27:08 UTC - mysqld got signal 6 ;

Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (7f04340087f0): UPDATE tab SET j1 = JSON_SET(j1, '$.a', 'x'), j2 = JSON_SET(j2, '$.a', 'y'), j1 = JSON_SET(j1, '$.b', 'z')
Connection ID (thread ID): 3
Status: NOT_KILLED

corefile:
-----------
Core was generated by `./bin/mysqld --no-defaults --datadir=./db1/ --basedir=. -u root --core-file'.
Program terminated with signal SIGABRT, Aborted.
#0  0x00007f04be2ca621 in __pthread_kill (threadid=<optimized out>, signo=6) at ../nptl/sysdeps/unix/sysv/linux/pthread_kill.c:61
61	../nptl/sysdeps/unix/sysv/linux/pthread_kill.c: No such file or directory.
(gdb) bt
#0  0x00007f04be2ca621 in __pthread_kill (threadid=<optimized out>, signo=6) at ../nptl/sysdeps/unix/sysv/linux/pthread_kill.c:61
#1  0x000000000269eadd in my_write_core (sig=6) at /home/viswanatham/GIT-MySQL/mysql/mysys/stacktrace.cc:291
#2  0x0000000001d8e484 in handle_fatal_signal (sig=6) at /home/viswanatham/GIT-MySQL/mysql/sql/signal_handler.cc:231
#3  <signal handler called>
#4  0x00007f04bd0c8f79 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#5  0x00007f04bd0cc388 in __GI_abort () at abort.c:89
#6  0x00007f04bd0c1e36 in __assert_fail_base (fmt=0x7f04bd213718 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", 
    assertion=assertion@entry=0x3313458 "m_partial_update_info == nullptr", 
    file=file@entry=0x3311898 "/home/viswanatham/GIT-MySQL/mysql/sql/table.cc", line=line@entry=7825, 
    function=function@entry=0x3315780 <TABLE::setup_partial_update()::__PRETTY_FUNCTION__> "bool TABLE::setup_partial_update()")
    at assert.c:92
#7  0x00007f04bd0c1ee2 in __GI___assert_fail (assertion=0x3313458 "m_partial_update_info == nullptr", 
    file=0x3311898 "/home/viswanatham/GIT-MySQL/mysql/sql/table.cc", line=7825, 
    function=0x3315780 <TABLE::setup_partial_update()::__PRETTY_FUNCTION__> "bool TABLE::setup_partial_update()") at assert.c:101
#8  0x0000000001b8df88 in TABLE::setup_partial_update (this=0x7f04340cb250) at /home/viswanatham/GIT-MySQL/mysql/sql/table.cc:7825
#9  0x00000000020bf3bd in Sql_cmd_update::update_single_table (this=0x7f043409f758, thd=0x7f0434000be0)
    at /home/viswanatham/GIT-MySQL/mysql/sql/sql_update.cc:548
#10 0x00000000020c2e4c in Sql_cmd_update::execute_inner (this=0x7f043409f758, thd=0x7f0434000be0)
    at /home/viswanatham/GIT-MySQL/mysql/sql/sql_update.cc:1678
#11 0x0000000001adbf49 in Sql_cmd_dml::execute (this=0x7f043409f758, thd=0x7f0434000be0)
    at /home/viswanatham/GIT-MySQL/mysql/sql/sql_select.cc:619
#12 0x0000000001a86897 in mysql_execute_command (thd=0x7f0434000be0, first_level=true)
    at /home/viswanatham/GIT-MySQL/mysql/sql/sql_parse.cc:3351
#13 0x0000000001a8c34b in mysql_parse (thd=0x7f0434000be0, parser_state=0x7f04adffd150)
    at /home/viswanatham/GIT-MySQL/mysql/sql/sql_parse.cc:5338
#14 0x0000000001a821c3 in dispatch_command (thd=0x7f0434000be0, com_data=0x7f04adffddb0, command=COM_QUERY)
    at /home/viswanatham/GIT-MySQL/mysql/sql/sql_parse.cc:1593
#15 0x0000000001a80fdf in do_command (thd=0x7f0434000be0) at /home/viswanatham/GIT-MySQL/mysql/sql/sql_parse.cc:1180
#16 0x0000000001d7ff9c in handle_connection (arg=0x5da50d0)
    at /home/viswanatham/GIT-MySQL/mysql/sql/conn_handler/connection_handler_per_thread.cc:322
#17 0x00000000026f123a in pfs_spawn_thread (arg=0x5f79a40) at /home/viswanatham/GIT-MySQL/mysql/storage/perfschema/pfs.cc:2407
#18 0x00007f04be2c5182 in start_thread (arg=0x7f04adffe700) at pthread_create.c:312
#19 0x00007f04bd18d30d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
(gdb) 

How to repeat:
CREATE TEMPORARY TABLE tab(id INT PRIMARY KEY, j1 JSON, j2 JSON);
INSERT INTO tab VALUES(1, '{"a":"a","b":"b"}', '{"a":"a","b":"b"}');
INSERT INTO tab VALUES(2, NULL, NULL);
INSERT INTO tab VALUES(3, '{"a":"aa","b":"bb"}', '{"a":"aa","b":"bb"}');
INSERT INTO tab VALUES(4, '["Sachin","Tendulkar"]','["Virat","Kohili"]');
INSERT INTO tab VALUES(5, '[100 ,{"A1": "Amarnath","B1": "Binni"}]','[200,{"A2": "Azar","S1": "Srikanth"}]');
INSERT INTO tab VALUES(6, '{"Chetan": [300,400],"Sasri": [500,600]}','{"Dhoni": [700,800],"Sidhu": [900,100]}');
ANALYZE TABLE tab;
SELECT * FROM tab;
EXPLAIN FORMAT=JSON UPDATE tab SET j1 = JSON_SET(j1, '$.a', 'x'),
j2 = JSON_SET(j2, '$.a', 'y'),
j1 = JSON_SET(j1, '$.b', 'z');
SELECT JSON_STORAGE_SIZE(j1),JSON_STORAGE_SIZE(j2) FROM tab;
SELECT JSON_STORAGE_FREE(j1),JSON_STORAGE_FREE(j2) FROM tab;

Suggested fix:
no crash
[5 Jun 2017 12:40] Paul DuBois
Posted by developer:
 
Fixed in 8.0.2.

Bug affects no released version. No changelog entry needed.