Bug #41003 log_bin_trust_function_creators_func test explicitly warns on a bug in it
Submitted: 25 Nov 2008 11:27 Modified: 21 Jan 17:19
Reporter: Andrei Elkin
Status: Closed
Category:Tests: Server Severity:S3 (Non-critical)
Version:5.1, 6.0 OS:Any
Assigned to: Andrei Elkin Target Version:5.1+
Triage: Triaged: D3 (Medium)

[25 Nov 2008 11:27] Andrei Elkin
Description:
The test has lines

--echo 'Bug: Create Function should give error here because non-super user';
--echo 'is creating function here';

right after CREATE FUNCTION f1() which creating succeeds.

However, the comments are correct as according to the test the create should fails. The
reason it does not appears to be in that the binlog is OFF even though
the test requests it to be ON with its opt file having --log-bin=test. 

To sum up there are these issues:

1. mtr seems to ignore the opt file (it's rather clear why with the rpl tree's   mtr
bug#40129);
2. the test needs removing the Bug-warnings;
3. the test needs deploying --error expectation before CREATE FUNCTION f1()
4. the test needs to verify if the binlog is ON not just if sql_log_bin of the session is
ON
5. (a precious dream of the report's author) session/global variables in mysql server
need parent-child relationship and constraints. E.g  @@session.sql_log_bin should be
never be ON if "@@global".log_bin is OFF
\footnote{log_bin is not syntactically global though, that's why quotes}

How to repeat:
Look at the test code.

Suggested fix:
Implement 1-4.
[26 Nov 2008 23:08] 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/59989

2704 Andrei Elkin	2008-11-27
      Bug #41003 log_bin_trust_function_creators_func test explicitly warns on a bug in
it
      
      The test 
      1. did not verify that CREATE FUNCTION shall fails in a case of active binlog
      and @@log_bin_trust_function_creators is zero if there is no DETERMINISTIC
qualifier 
      and super user privilege;
      2. contained an explit warning on that CREATE FUNCTION actually succeeded whereas
      it was supposed to fail;
      3. did not demand the bin-log be set ON even though it has contained the opt file
      explictily setting the name for the binlog file.
      
      Fixed 1-3 with modifying the test accordingly.
[26 Nov 2008 23:14] 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/59990

2704 Andrei Elkin	2008-11-27
      Bug #41003 log_bin_trust_function_creators_func test explicitly warns on a bug in
it
      
      The test 
      1. did not verify that CREATE FUNCTION shall fails in a case of active binlog
      and @@log_bin_trust_function_creators is zero if there is no DETERMINISTIC
qualifier 
      and super user privilege;
      2. contained an explit warning on that CREATE FUNCTION actually succeeded whereas
      it was supposed to fail;
      3. did not demand the bin-log be set ON even though it has contained the opt file
      explictily setting the name for the binlog file.
      
      Fixed 1-3 with modifying the test accordingly.
[26 Nov 2008 23:19] 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/59991

2704 Andrei Elkin	2008-11-27
      Bug #41003 log_bin_trust_function_creators_func test explicitly warns on a bug in
it
      
      The test 
      1. did not verify that CREATE FUNCTION shall fails in a case of active binlog
      and @@log_bin_trust_function_creators is zero if there is no DETERMINISTIC
qualifier 
      and super user privilege;
      2. contained an explit warning on that CREATE FUNCTION actually succeeded whereas
      it was supposed to fail;
      3. did not demand the bin-log be set ON even though it 
      4. contained the opt file explictily setting the name for the binlog file that was
never
         referred in the test.
      
      Fixed 1-4 with modifying the test accordingly. Particularly the opt file is 
      removed to leave the binlog file per mtr invocation argument and making it
      "anonymous" without any impact on logics of the test.
[27 Nov 2008 11:57] 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/60017

2704 Andrei Elkin	2008-11-27
      Bug #41003 log_bin_trust_function_creators_func test explicitly warns on a bug in
it
      
      The test 
      1. did not verify that CREATE FUNCTION shall fails in a case of active binlog
      and @@log_bin_trust_function_creators is zero if there is no DETERMINISTIC
qualifier 
      and super user privilege;
      2. contained an explit warning on that CREATE FUNCTION actually succeeded whereas
      it was supposed to fail;
      3. did not demand the bin-log be set ON even though it has contained the opt file
      explictily setting the name for the binlog file.
      
      Fixed 1-3 with modifying the test accordingly.
[12 Dec 2008 20:16] 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/61541

2739 Andrei Elkin	2008-12-12
      Bug #41003 log_bin_trust_function_creators_func test explicitly warns on a bug in
it
      
      The test 
      1. did not verify that CREATE FUNCTION shall fails in a case of active binlog
         and @@log_bin_trust_function_creators is zero if there is no DETERMINISTIC
qualifier
         and super user privilege;
      2. contained an explit warning on that CREATE FUNCTION actually succeeded whereas
         it was supposed to fail;
      3. did not demand the bin-log be set ON even though it has contained the opt file
         explictily setting the name for the binlog file.
            
      Fixed 1-3 with modifying the test accordingly.
[12 Dec 2008 23:25] Andrei Elkin
pushed to bt.
[15 Jan 7:37] Bugs System
Pushed into 5.1.31 (revid:joro@sun.com-20090115053147-tx1oapthnzgvs1ro) (version source
revid:azundris@mysql.com-20081230114838-cn52tu180wcrvh0h) (merge vers: 5.1.31) (pib:6)
[16 Jan 4:46] Paul DuBois
Test case changes. No changelog entry needed.

Setting report to NDI pending push into 6.0.x.
[19 Jan 12:23] Bugs System
Pushed into 5.1.31-ndb-6.2.17 (revid:tomas.ulin@sun.com-20090119095303-uwwvxiibtr38djii)
(version source revid:tomas.ulin@sun.com-20090115073240-1wanl85vlvw2she1) (merge vers:
5.1.31-ndb-6.2.17) (pib:6)
[19 Jan 14:01] Bugs System
Pushed into 5.1.31-ndb-6.3.21 (revid:tomas.ulin@sun.com-20090119104956-guxz190n2kh31fxl)
(version source revid:tomas.ulin@sun.com-20090119104956-guxz190n2kh31fxl) (merge vers:
5.1.31-ndb-6.3.21) (pib:6)
[19 Jan 16:55] Jon Stephens
Setting status back to NDI pending merge to 6.0 tree.
[19 Jan 17:07] Bugs System
Pushed into 5.1.31-ndb-6.4.1 (revid:tomas.ulin@sun.com-20090119144033-4aylstx5czzz88i5)
(version source revid:tomas.ulin@sun.com-20090119144033-4aylstx5czzz88i5) (merge vers:
5.1.31-ndb-6.4.1) (pib:6)
[20 Jan 19:54] Bugs System
Pushed into 6.0.10-alpha (revid:joro@sun.com-20090119171328-2hemf2ndc1dxl0et) (version
source revid:azundris@mysql.com-20081230114916-c290n83z25wkt6e4) (merge vers:
6.0.9-alpha) (pib:6)
[21 Jan 17:19] Paul DuBois
Test case changes. No changelog entry needed.
[29 Jan 14:29] 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/64477

2727 Alfranio Correia	2009-01-29
      Re-enabled log_bin_trust_function_creators_func as the patch in 
      BUG#41003 reached our trees.
[30 Jan 14:27] Bugs System
Pushed into 6.0.10-alpha (revid:luis.soares@sun.com-20090129165607-wiskabxm948yx463)
(version source revid:luis.soares@sun.com-20090129163120-e2ntks4wgpqde6zt) (merge vers:
6.0.10-alpha) (pib:6)
[30 Jan 16:08] Bugs System
Pushed into 5.1.32 (revid:luis.soares@sun.com-20090129165946-d6jnnfqfokuzr09y) (version
source revid:luis.soares@sun.com-20090129162554-kolr29h6mkn4i28k) (merge vers: 5.1.32)
(pib:6)
[17 Feb 15:54] Bugs System
Pushed into 5.1.32-ndb-6.3.23 (revid:tomas.ulin@sun.com-20090217131017-6u8qz1edkjfiobef)
(version source revid:tomas.ulin@sun.com-20090203133556-9rclp06ol19bmzs4) (merge vers:
5.1.32-ndb-6.3.22) (pib:6)
[17 Feb 17:42] Bugs System
Pushed into 5.1.32-ndb-6.4.3 (revid:tomas.ulin@sun.com-20090217134419-5ha6xg4dpedrbmau)
(version source revid:tomas.ulin@sun.com-20090203133556-9rclp06ol19bmzs4) (merge vers:
5.1.32-ndb-6.3.22) (pib:6)
[17 Feb 19:18] Bugs System
Pushed into 5.1.32-ndb-6.2.17 (revid:tomas.ulin@sun.com-20090217134216-5699eq74ws4oxa0j)
(version source revid:tomas.ulin@sun.com-20090201210519-vehobc4sy3g9s38e) (merge vers:
5.1.32-ndb-6.2.17) (pib:6)