Bug #47734 Assertion failed: ! is_set() when locking a view with non-existing definer
Submitted: 30 Sep 2009 4:46 Modified: 17 Jun 2010 22:42
Reporter: Shane Bester (Platinum Quality Contributor) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Views Severity:S6 (Debug Builds)
Version:5.1.39-debug, 5.1, 5.4 bzr OS:Any
Assigned to: Davi Arnaut CPU Architecture:Any
Tags: assertion

[30 Sep 2009 4:46] Shane Bester
Description:
In bug #46958 davi says this is a new bug.
debug assertion when locking a view with non-existing definer

Assertion failed: ! is_set(), file .\sql_class.cc, line 437
mysqld-debug.exe!my_sigabrt_handler()[mysqld.cc:2029]
mysqld-debug.exe!raise()[winsig.c:597]
mysqld-debug.exe!abort()[abort.c:78]
mysqld-debug.exe!_wassert()[assert.c:212]
mysqld-debug.exe!Diagnostics_area::set_ok_status()[sql_class.cc:437]
mysqld-debug.exe!my_ok()[sql_class.h:2313]
mysqld-debug.exe!mysql_execute_command()[sql_parse.cc:3510]
mysqld-debug.exe!mysql_parse()[sql_parse.cc:5935]
mysqld-debug.exe!dispatch_command()[sql_parse.cc:1215]
mysqld-debug.exe!do_command()[sql_parse.cc:854]
mysqld-debug.exe!handle_one_connection()[sql_connect.cc:1127]
mysqld-debug.exe!pthread_start()[my_winthread.c:85]
mysqld-debug.exe!_callthreadstart()[thread.c:295]
mysqld-debug.exe!_threadstart()[thread.c:277]

How to repeat:
#start debug build and make sure `nobody`@`nobody` user does not exist.

create or replace definer=`nobody`@`nobody` sql security definer view `view1` 
as select now();
lock table `view1` read;
[30 Sep 2009 5:38] Sveta Smirnova
Thank you for the report.

Verified as described.
[27 Jan 2010 13:11] 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/98329

3335 Davi Arnaut	2010-01-27
      Bug#47734: Assertion failed: ! is_set() when locking a view with non-existing definer
      
      The problem was that a failure to open a view wasn't being
      properly handled. When opening a view with unknown definer,
      the open procedure would be treated as successful and would
      later crash when attempting to lock the view (which wasn't
      opened to begin with).
      
      The solution is to skip further processing when opening a
      table if it fails with a fatal error.
     @ mysql-test/r/view.result
        Add test case result for Bug#47734.
     @ mysql-test/t/view.test
        Add test case for Bug#47734.
     @ sql/sql_base.cc
        Skip further processing if opening a table failed due to
        a fatal error (for the statement).
[11 Feb 2010 21:01] Davi Arnaut
Queued to mysql-5.1-bugteam.
[1 Mar 2010 8:42] Bugs System
Pushed into 5.1.45 (revid:joro@sun.com-20100301083827-xnimmrjg6bh33o1o) (version source revid:joerg@mysql.com-20100212173307-ph563zr4wmoklgwd) (merge vers: 5.1.45) (pib:16)
[2 Mar 2010 14:32] Bugs System
Pushed into 6.0.14-alpha (revid:alik@sun.com-20100302142746-u1gxdf5yk2bjrq3e) (version source revid:alik@sun.com-20100225090938-2j5ybqoau570mytu) (merge vers: 6.0.14-alpha) (pib:16)
[2 Mar 2010 14:37] Bugs System
Pushed into 5.5.3-m2 (revid:alik@sun.com-20100302072233-t3uqgjzdukt1pyhe) (version source revid:alexey.kopytov@sun.com-20100221213311-xf5nyv391dsw9v6j) (merge vers: 5.5.2-m2) (pib:16)
[2 Mar 2010 14:42] Bugs System
Pushed into mysql-next-mr (revid:alik@sun.com-20100302072432-k8xvfkgcggkwgi94) (version source revid:alik@sun.com-20100224135227-rcqs9pe9b2in80pf) (pib:16)
[14 Mar 2010 1:47] Paul DuBois
Noted in 5.1.45, 5.5.3, 6.0.14 changelogs.

Failure to open a view with a nonexistent DEFINER was improperly
handled and the server would crash later attempting to lock the view.
[17 Jun 2010 12:02] Bugs System
Pushed into 5.1.47-ndb-7.0.16 (revid:martin.skold@mysql.com-20100617114014-bva0dy24yyd67697) (version source revid:vasil.dimov@oracle.com-20100331130613-8ja7n0vh36a80457) (merge vers: 5.1.46) (pib:16)
[17 Jun 2010 12:44] Bugs System
Pushed into 5.1.47-ndb-6.2.19 (revid:martin.skold@mysql.com-20100617115448-idrbic6gbki37h1c) (version source revid:martin.skold@mysql.com-20100609140708-52rvuyq4q500sxkq) (merge vers: 5.1.45-ndb-6.2.19) (pib:16)
[17 Jun 2010 13:29] Bugs System
Pushed into 5.1.47-ndb-6.3.35 (revid:martin.skold@mysql.com-20100617114611-61aqbb52j752y116) (version source revid:vasil.dimov@oracle.com-20100331130613-8ja7n0vh36a80457) (merge vers: 5.1.46) (pib:16)