Bug #46075 Assertion failed: 0, file .\protocol.cc, line 416
Submitted: 9 Jul 2009 9:35 Modified: 8 Aug 2009 0:46
Reporter: Shane Bester (Platinum Quality Contributor) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: DML Severity:S6 (Debug Builds)
Version:5.0.84-debug,5.1.37-debug, 5.4.2-debug, 5.4.4-debug OS:Any
Assigned to: Alexey Kopytov CPU Architecture:Any
Tags: assertion
Triage: Triaged: D2 (Serious)

[9 Jul 2009 9:35] Shane Bester
Description:
after an error (e.g. table is full), insert ignore causes a debug assertion to fail.

5.1.37-debug:

090709 11:28:37 [ERROR] mysqld: The table 'f:\tmp\#sql97c_3_0' is full
Assertion failed: 0, file .\protocol.cc, line 416

mysqld.exe!my_sigabrt_handler()[mysqld.cc:2014]
mysqld.exe!raise()[winsig.c:590]
mysqld.exe!abort()[abort.c:71]
mysqld.exe!_wassert()[assert.c:212]
mysqld.exe!net_end_statement()[protocol.cc:416]
mysqld.exe!dispatch_command()[sql_parse.cc:1583]
mysqld.exe!do_command()[sql_parse.cc:854]
mysqld.exe!handle_one_connection()[sql_connect.cc:1127]
mysqld.exe!pthread_start()[my_winthread.c:85]
mysqld.exe!_callthreadstart()[thread.c:293]
mysqld.exe!_threadstart()[thread.c:277]
kernel32.dll!FlsSetValue()

In 5.0.84-debug the assertion is not hit.  Instead, the query
completes ok, but the client hangs...

How to repeat:
#paste into command line client and run against debug build:

set global myisam_data_pointer_size=2;
\r
drop table if exists t1;
create table t1(a char(255),b char(255),c char(255),key(a),key(b),key(c))engine=myisam charset=utf8;
insert into t1 values ('a','b','c'),('d','e','f'),('g','h','i');
insert ignore into t1 values ('a','b','c'),('d','e','f'),('g','h','i');
insert ignore into t1 select t1.a,t1.b,t1.c from t1,t1 t2,t1 t3,t1 t4,t1 t5,t1 t6,t1 t7;
[9 Jul 2009 9:54] Valeriy Kravchuk
With non-debug 5.1.36 I've got just warning:

mysql> insert ignore into t1 select t1.a,t1.b,t1.c from t1,t1 t2,t1 t3,t1 t4,t1
t5,t1 t6,t1 t7;
Query OK, 0 rows affected, 1 warning (11.05 sec)

mysql> show warnings\G
*************************** 1. row ***************************
  Level: Error
   Code: 1114
Message: The table 'C:\WINDOWS\TEMP\#sqlf78_6_0' is full
1 row in set (0.02 sec)

mysql> select version();
+------------------+
| version()        |
+------------------+
| 5.1.36-community |
+------------------+
1 row in set (0.00 sec)
[9 Jul 2009 10:04] Valeriy Kravchuk
Verified just as described with debug binaries on Linux.
[24 Jul 2009 11:51] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/79242

2804 Alexey Kopytov	2009-07-24
      Bug #46075: Assertion failed: 0, file .\protocol.cc, line 416 
      
      In create_myisam_from_heap() mark all errors as fatal except 
      HA_ERR_RECORD_FILE_FULL for a HEAP table.
      
      Not doing so could lead to problems, e.g. in a case when a
      temporary MyISAM table gets overrun due to its MAX_ROWS limit
      while executing INSERT/REPLACE IGNORE ... SELECT. 
      The SELECT execution was aborted, but the error was 
      converted to a warning due to IGNORE clause, so neither 'ok' 
      nor 'error' packet could be sent back to the client. This 
      condition led to hanging client when using 5.0 server, or 
      assertion failure in 5.1.
      modified:
        mysql-test/r/insert_select.result
        mysql-test/t/insert_select.test
        sql/sql_select.cc
[24 Jul 2009 20:05] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/79282

3461 Alexey Kopytov	2009-07-25
      Fixed the patch for bug #46075 for 6.0: pass 
      ME_FATALERROR flag to print_error() instead of
      calling THD::fatal_error().
      modified:
        sql/sql_select.cc
[4 Aug 2009 13:56] Bugs System
Pushed into 5.0.85 (revid:davi.arnaut@sun.com-20090804135315-6lfdnk4zjwk7kn7r) (version source revid:davi.arnaut@sun.com-20090804135315-6lfdnk4zjwk7kn7r) (merge vers: 5.0.85) (pib:11)
[4 Aug 2009 19:52] Bugs System
Pushed into 5.4.4-alpha (revid:alik@sun.com-20090804194615-h40sa098mx4z49qg) (version source revid:satya.bn@sun.com-20090727062228-uf93hg5izc1lpe3z) (merge vers: 5.4.4-alpha) (pib:11)
[4 Aug 2009 20:45] Bugs System
Pushed into 5.1.38 (revid:davi.arnaut@sun.com-20090804204317-ggodqkik7de6nfpz) (version source revid:davi.arnaut@sun.com-20090804204317-ggodqkik7de6nfpz) (merge vers: 5.1.38) (pib:11)
[8 Aug 2009 0:46] Paul Dubois
Noted in 5.0.85, 5.1.38, 5.4.4 changelogs.

After an error such as a table-full condition, INSERT IGNORE could
cause an assertion failure for debug builds.
[12 Aug 2009 22:10] Paul Dubois
Noted in 5.4.2 changelog because next 5.4 version will be 5.4.2 and not 5.4.4.
[14 Aug 2009 23:01] Paul Dubois
Ignore previous comment about 5.4.2.
[1 Oct 2009 5:59] Bugs System
Pushed into 5.1.39-ndb-6.3.28 (revid:jonas@mysql.com-20091001055605-ap2kiaarr7p40mmv) (version source revid:jonas@mysql.com-20091001055605-ap2kiaarr7p40mmv) (merge vers: 5.1.39-ndb-6.3.28) (pib:11)
[1 Oct 2009 7:25] Bugs System
Pushed into 5.1.39-ndb-7.0.9 (revid:jonas@mysql.com-20091001072547-kv17uu06hfjhgjay) (version source revid:jonas@mysql.com-20091001071652-irejtnumzbpsbgk2) (merge vers: 5.1.39-ndb-7.0.9) (pib:11)
[1 Oct 2009 13:25] Bugs System
Pushed into 5.1.39-ndb-7.1.0 (revid:jonas@mysql.com-20091001123013-g9ob2tsyctpw6zs0) (version source revid:jonas@mysql.com-20091001123013-g9ob2tsyctpw6zs0) (merge vers: 5.1.39-ndb-7.1.0) (pib:11)
[5 Oct 2009 10:50] Bugs System
Pushed into 5.1.39-ndb-6.2.19 (revid:jonas@mysql.com-20091005103850-dwij2dojwpvf5hi6) (version source revid:jonas@mysql.com-20090930185117-bhud4ek1y0hsj1nv) (merge vers: 5.1.39-ndb-6.2.19) (pib:11)
[16 Jan 2010 0:56] Paul Dubois
Noted in 5.5.0 changelog.