Bug #48995 abort missing DBUG_RETURN or .. in function "check_key_in_view"
Submitted: 23 Nov 2009 14:21 Modified: 12 Mar 2010 16:46
Reporter: Matthias Leich Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Views Severity:S3 (Non-critical)
Version:mysql-6.0-codebase-bugfixing OS:Any
Assigned to: Jon Olav Hauglid CPU Architecture:Any
Triage: Triaged: D1 (Critical)

[23 Nov 2009 14:21] Matthias Leich
Description:
Found during RQG test execution
(30 threads, WL5004 grammar)
-------------------------------
# 14:01:50 Thread 1 (process 15869):
# 14:01:50 #0  0x00007fce2f90c1f6 in pthread_kill () from /lib/libpthread.so.0
# 14:01:50 #1  0x0000000000b7b068 in my_write_core (sig=6) at stacktrace.c:309
# 14:01:50 #2  0x00000000006f6b37 in handle_segfault (sig=6) at mysqld.cc:2765
# 14:01:50 #3  <signal handler called>
# 14:01:50 #4  0x00007fce2e7c0fb5 in raise () from /lib/libc.so.6
# 14:01:50 #5  0x00007fce2e7c2bc3 in abort () from /lib/libc.so.6
# 14:01:50 #6  0x0000000000b95cad in DbugExit (
# 14:01:50     why=0x7fce22f75e30 "missing DBUG_RETURN or DBUG_VOID_RETURN macro in function \"check_key_in_view\"\n") at dbug.c:2150
# 14:01:50 #7  0x0000000000b9480c in _db_return_ (_line_=506,
# 14:01:50     _stack_frame_=0x7fce22f76090) at dbug.c:1242
# 14:01:50 #8  0x00000000007d6b26 in mysql_prepare_delete (thd=0x353d628,
# 14:01:50     table_list=0x35a4600, conds=0x7fce22f761a8) at sql_delete.cc:506
# 14:01:50 #9  0x00000000007d6e0e in mysql_delete (thd=0x353d628, table_list=0x35a4600,
# 14:01:50     conds=0x7fce1c03ebb8, order=0x353f7e0, limit=1, options=0,
# 14:01:50     reset_auto_increment=false) at sql_delete.cc:77
# 14:01:50 #10 0x000000000070c974 in mysql_execute_command (thd=0x353d628)
# 14:01:50     at sql_parse.cc:3382
# 14:01:50 #11 0x0000000000711b9c in mysql_parse (thd=0x353d628,
# 14:01:50     inBuf=0x35a44c0 "DELETE   FROM testdb_S . t1_view1_N  WHERE `pk` > 2 LIMIT 1", length=59, found_semicolon=0x7fce22f788f8) at sql_parse.cc:5975
# 14:01:50 #12 0x00000000007127f9 in dispatch_command (command=COM_QUERY, thd=0x353d628,
# 14:01:50     packet=0x35847c9 "DELETE   FROM testdb_S . t1_view1_N  WHERE `pk` > 2 LIMIT 1", packet_length=59) at sql_parse.cc:1076
# 14:01:50 #13 0x0000000000713dd3 in do_command (thd=0x353d628) at sql_parse.cc:758
# 14:01:50 #14 0x00000000007010cb in handle_one_connection (arg=0x353d628)
# 14:01:50     at sql_connect.cc:1164
# 14:01:50 #15 0x00007fce2f9073ba in start_thread () from /lib/libpthread.so.0
# 14:01:50 #16 0x00007fce2e873fcd in clone () from /lib/libc.so.6
# 14:01:50 #17 0x0000000000000000 in ?? ()

There were similar crashes. They all contain basically a
INSERT/UPDATE/LOAD DATA  <view>

I hope that I can come up with a replay testcase soon.

My environment:
- mysql-6.0-codebase-bugfixing ~ 2009-11-15
  ./BUILD/compile-pentium64-debug-max
- Linux OpenSuSE 11.0 (64 Bit)
- Intel Core2Duo (64 Bit)

How to repeat:
Not available
[23 Nov 2009 14:37] Sergei Golubchik
it's obvious when you look at the code, no need for a test case
[2 Dec 2009 13:28] 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/92446

3238 Jon Olav Hauglid	2009-12-02
      Bug #48995 abort missing DBUG_RETURN or .. in function "check_key_in_view"
      
      check_key_in_view() had one code branch which returned with "return TRUE"
      rather than "DBUG_RETURN(TRUE)". Only affected debug builds.
      
      No test case added.
[15 Dec 2009 9: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/94069

3273 Jon Olav Hauglid	2009-12-15
      Bug #48995 abort missing DBUG_RETURN or .. in function "check_key_in_view"
      
      check_key_in_view() had one code branch which returned with "return TRUE"
      rather than "DBUG_RETURN(TRUE)". Only affected debug builds.
      
      No test case added.
[15 Dec 2009 9:28] Jon Olav Hauglid
Pushed to mysql-5.1-bugteam and merged to mysql-pe.
[19 Dec 2009 8:27] Bugs System
Pushed into 6.0.14-alpha (revid:alik@sun.com-20091219082307-f3i4fn0tm8trb3c0) (version source revid:alik@sun.com-20091216180721-eoa754i79j4ssd3m) (merge vers: 6.0.14-alpha) (pib:15)
[19 Dec 2009 8:31] Bugs System
Pushed into 5.5.1-m2 (revid:alik@sun.com-20091219082021-f34nq4jytwamozz0) (version source revid:alexey.kopytov@sun.com-20091216134707-o96eqw0u2ynvo9gm) (merge vers: 5.5.0-beta) (pib:15)
[19 Dec 2009 8:35] Bugs System
Pushed into mysql-next-mr (revid:alik@sun.com-20091219082213-nhjjgmphote4ntxj) (version source revid:alik@sun.com-20091216180221-a5ps59gajad3pip9) (pib:15)
[8 Jan 2010 17:26] Paul Dubois
Noted in 5.5.1, 6.0.14 changelogs.

check_key_in_view() was missing a DBUG_RETURN in one code branch,
causing a crash in debug builds.

Setting report to NDI pending push to 5.1.x, Celosia.
[15 Jan 2010 8:59] Bugs System
Pushed into 5.1.43 (revid:joro@sun.com-20100115085139-qkh0i0fpohd9u9p5) (version source revid:jon.hauglid@sun.com-20091215090520-a68v9izx1awixh3s) (merge vers: 5.1.42) (pib:16)
[15 Jan 2010 19:03] Paul Dubois
Noted in 5.1.43 changelog.

Setting report to NDI pending push to Celosia.
[8 Mar 2010 10:22] Jon Olav Hauglid
Patch verified to be in mysql-trunk. Setting to Documenting.
[8 Mar 2010 15:39] Paul Dubois
Already fixed in earlier 5.5.x. Closing.
[12 Mar 2010 14:13] Bugs System
Pushed into 5.1.44-ndb-7.0.14 (revid:jonas@mysql.com-20100312135944-t0z8s1da2orvl66x) (version source revid:jonas@mysql.com-20100312115609-woou0te4a6s4ae9y) (merge vers: 5.1.44-ndb-7.0.14) (pib:16)
[12 Mar 2010 14:29] Bugs System
Pushed into 5.1.44-ndb-6.2.19 (revid:jonas@mysql.com-20100312134846-tuqhd9w3tv4xgl3d) (version source revid:jonas@mysql.com-20100312060623-mx6407w2vx76h3by) (merge vers: 5.1.44-ndb-6.2.19) (pib:16)
[12 Mar 2010 14:46] Bugs System
Pushed into 5.1.44-ndb-6.3.33 (revid:jonas@mysql.com-20100312135724-xcw8vw2lu3mijrhn) (version source revid:jonas@mysql.com-20100312103652-snkltsd197l7q2yg) (merge vers: 5.1.44-ndb-6.3.33) (pib:16)
[7 Feb 2013 13:36] Erlend Dahl
Bug#47789 was marked as a duplicate.