[MDEV-5979] Server crashes on truncating a temporary InnoDB table on Windows Created: 2014-03-28  Updated: 2014-03-28  Resolved: 2014-03-28

Status: Closed
Project: MariaDB Server
Component/s: None
Affects Version/s: 10.0.9
Fix Version/s: 10.0.10

Type: Bug Priority: Critical
Reporter: Elena Stepanova Assignee: Sergei Golubchik
Resolution: Fixed Votes: 0
Labels: None
Environment:

Windows



 Description   

--source include/have_innodb.inc
 
create temporary table tmp (i int) engine=innodb;
truncate table tmp;

mysqld.exe!handle_rtc_failure(int err_type, const char * file, int line, const char * module, const char * format, ...)  Line 284	C
mysqld.exe!failwithmessage(void * retaddr, int crttype, int errnum, const char * msg)  + 0x223 bytes	C++
mysqld.exe!_RTC_UninitUse(const char * varname)  + 0xee bytes	C++
mysqld.exe!Sql_cmd_truncate_table::handler_truncate(THD * thd, TABLE_LIST * table_ref, bool is_tmp_table)  Line 228 + 0x13 bytes	C++
mysqld.exe!Sql_cmd_truncate_table::truncate_table(THD * thd, TABLE_LIST * table_ref)  Line 444 + 0x20 bytes	C++
mysqld.exe!Sql_cmd_truncate_table::execute(THD * thd)  Line 534 + 0x1a bytes	C++
mysqld.exe!mysql_execute_command(THD * thd)  Line 5109 + 0x2c bytes	C++
mysqld.exe!mysql_parse(THD * thd, char * rawbuf, unsigned int length, Parser_state * parser_state)  Line 6452 + 0xd bytes	C++
mysqld.exe!dispatch_command(enum_server_command command, THD * thd, char * packet, unsigned int packet_length)  Line 1311	C++
mysqld.exe!do_command(THD * thd)  Line 1005 + 0x25 bytes	C++
mysqld.exe!do_handle_one_connection(THD * thd_arg)  Line 1379 + 0xa bytes	C++
mysqld.exe!handle_one_connection(void * arg)  Line 1294	C++
mysqld.exe!pfs_spawn_thread(void * arg)  Line 1855	C++
mysqld.exe!pthread_start(void * p)  Line 61	C
mysqld.exe!_callthreadstartex()  Line 314 + 0x17 bytes	C
mysqld.exe!_threadstartex(void * ptd)  Line 297	C

revision-id: monty@mariadb.org-20140328194257-zr9f894fd4h9lqgy
date: 2014-03-28 21:42:57 +0200
build-date: 2014-03-28 13:17:47 -0700
revno: 4134
branch-nick: 10.0



 Comments   
Comment by Sergei Petrunia [ 2014-03-28 ]

The code in Sql_cmd_truncate_table::handler_truncate goes like this:

  uint flags;
  ...
  if (!is_tmp_table)
  {
     ...
    flags= MYSQL_OPEN_IGNORE_FLUSH;
     ...
  }
 
  if (open_and_lock_tables(thd, table_ref, FALSE, flags))
  ..

if is_tmp_table==true, then 'flags' will have garbage value which will be
passed to open_and_lock_tables.

Comment by Vladislav Vaintroub [ 2014-03-28 ]

Microsoft compiler adds runtime checks for uninitialized variables in debug version (of course, it also complains during compilation about possibly uninitialized variables )
Here, the crash is failed runtime check.

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