[MDEV-15762] VARCHAR(0) COMPRESSED crashes the server Created: 2018-04-03  Updated: 2018-05-29  Resolved: 2018-04-20

Status: Closed
Project: MariaDB Server
Component/s: Server
Affects Version/s: 10.3
Fix Version/s: 10.3.7

Type: Bug Priority: Major
Reporter: Sergey Vojtovich Assignee: Sergey Vojtovich
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Blocks
blocks MDEV-15592 Column COMPRESSED should select a 'hi... Closed

 Description   

Test:

CREATE TABLE t1(a VARCHAR(0) COMPRESSED);
INSERT INTO t1 VALUES('a');
DROP TABLE t1;

Stack trace:

mysqld: sql/field.cc:8023: int Field_longstr::compress(char*, uint*, const char*, uint, CHARSET_INFO*): Assertion `length > 0' failed.
 
/usr/lib/x86_64-linux-gnu/libasan.so.2(+0x4a077)[0x7efdd0cb3077]
mysys/stacktrace.c:269(my_print_stacktrace)[0x5598e42ae945]
sql/signal_handler.cc:168(handle_fatal_signal)[0x5598e31f1f0d]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x11390)[0x7efdcf400390]
/lib/x86_64-linux-gnu/libc.so.6(gsignal+0x38)[0x7efdce7b9428]
/lib/x86_64-linux-gnu/libc.so.6(abort+0x16a)[0x7efdce7bb02a]
/lib/x86_64-linux-gnu/libc.so.6(+0x2dbd7)[0x7efdce7b1bd7]
/lib/x86_64-linux-gnu/libc.so.6(+0x2dc82)[0x7efdce7b1c82]
sql/field.cc:8026(Field_longstr::compress(char*, unsigned int*, char const*, unsigned int, charset_info_st const*))[0x5598e31ab848]
sql/field.cc:8092(Field_varstring_compressed::store(char const*, unsigned long, charset_info_st const*))[0x5598e31ac4be]
sql/item.cc:500(Item::save_str_value_in_field(Field*, String*))[0x5598e323127e]
sql/item.cc:7007(Item_string::save_in_field(Field*, bool))[0x5598e32629ef]
sql/sql_base.cc:8457(fill_record(THD*, TABLE*, Field**, List<Item>&, bool, bool))[0x5598e2a17d5a]
sql/sql_base.cc:8510(fill_record_n_invoke_before_triggers(THD*, TABLE*, Field**, List<Item>&, bool, trg_event_type))[0x5598e2a181a3]
sql/sql_insert.cc:1011(mysql_insert(THD*, TABLE_LIST*, List<Item>&, List<List<Item> >&, List<Item>&, List<Item>&, enum_duplicates, bool))[0x5598e2aaff84]
sql/sql_parse.cc:4724(mysql_execute_command(THD*))[0x5598e2b3fa96]
sql/sql_parse.cc:8013(mysql_parse(THD*, char*, unsigned int, Parser_state*, bool, bool))[0x5598e2b54c5e]
sql/sql_parse.cc:1844(dispatch_command(enum_server_command, THD*, char*, unsigned int, bool, bool))[0x5598e2b2f998]
sql/sql_parse.cc:1387(do_command(THD*))[0x5598e2b2c9bf]
sql/sql_connect.cc:1402(do_handle_one_connection(CONNECT*))[0x5598e2e7a5f6]
sql/sql_connect.cc:1309(handle_one_connection)[0x5598e2e79f5c]
perfschema/pfs.cc:1864(pfs_spawn_thread)[0x5598e3708ac3]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x76ba)[0x7efdcf3f66ba]
/lib/x86_64-linux-gnu/libc.so.6(clone+0x6d)[0x7efdce88b41d]



 Comments   
Comment by Sergey Vojtovich [ 2018-04-03 ]

serg, please review patch attached to this issue.

Comment by Alexander Barkov [ 2018-04-19 ]

https://github.com/mariadb/server/commit/cd93bbdea5f57ea28bfe2d109658730784683fd6 looks ok to push

Generated at Thu Feb 08 08:23:49 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.