List:Commits« Previous MessageNext Message »
From:Dmitry Shulga Date:June 8 2011 2:02pm
Subject:bzr push into mysql-trunk branch (Dmitry.Shulga:3166 to 3167) Bug#11763757
View as plain text  
 3167 Dmitry Shulga	2011-06-08 [merge]
      Auto-merge of patch for bug#11763757.

    modified:
      mysql-test/r/sp_notembedded.result
      mysql-test/t/sp_notembedded.test
 3166 Olav Sandstaa	2011-06-07
      This is a re-factoring patch that is a follow-up to the fix for
      Bug#11873324.
      
      The patch for Bug#11873324 introduced a new member function called
      has_guarded_conds() for the JOIN_TAB and the TABLE_REF classes. This
      function checks if the JOIN_TAB/TABLE_REF has triggered/guarded
      conditions. There exists other places in the optimizer code that do
      this check directly. The code for some of these places can be
      simplified by using the new member functions. This is implemented in
      this patch by replacing this code with calls to has_guarded_conds().
      
      This is a re-factoring patch and should have no changes to existing
      behavior.
     @ sql/sql_select.cc
        Refactoring: simplify code that checked for triggered/guarded
        condition directly by instead calling
        JOIN_TAB::has_guarded_conds().

    modified:
      sql/sql_select.cc
=== modified file 'mysql-test/r/sp_notembedded.result'
--- a/mysql-test/r/sp_notembedded.result	2011-03-18 14:16:17 +0000
+++ b/mysql-test/r/sp_notembedded.result	2011-06-08 13:44:50 +0000
@@ -254,7 +254,6 @@ CREATE PROCEDURE p1(i INT) BEGIN END;
 DROP PROCEDURE p1;
 DELETE FROM mysql.user WHERE User='mysqltest_1';
 FLUSH PRIVILEGES;
-set @@global.concurrent_insert= @old_concurrent_insert;
 #
 # Bug#44521 Prepared Statement: CALL p() - crashes: `! thd->main_da.is_sent' failed et.al.
 #
@@ -288,3 +287,25 @@ DROP FUNCTION f1;
 # ------------------------------------------------------------------
 # -- End of 5.1 tests
 # ------------------------------------------------------------------
+#
+# Test for bug#11763757 "56510: ERROR 42000: FUNCTION DOES NOT EXIST
+# IF NOT-PRIV USER RECONNECTS ".
+#
+# The real problem was that server was unable handle properly stored
+# functions in databases which names contained dot.
+#
+DROP DATABASE IF EXISTS `my.db`;
+create database `my.db`;
+use `my.db`;
+CREATE FUNCTION f1(a int) RETURNS INT RETURN a;
+# Create new connection.
+USE `my.db`;
+SELECT f1(1);
+f1(1)
+1
+SELECT `my.db`.f1(2);
+`my.db`.f1(2)
+2
+# Switching to default connection.
+DROP DATABASE `my.db`;
+set @@global.concurrent_insert= @old_concurrent_insert;

=== modified file 'mysql-test/t/sp_notembedded.test'
--- a/mysql-test/t/sp_notembedded.test	2010-08-06 11:29:37 +0000
+++ b/mysql-test/t/sp_notembedded.test	2011-06-08 13:44:50 +0000
@@ -371,16 +371,6 @@ DELETE FROM mysql.user WHERE User='mysql
 FLUSH PRIVILEGES;
 
 
-#
-# Restore global concurrent_insert value. Keep in the end of the test file.
-#
-
-set @@global.concurrent_insert= @old_concurrent_insert;
-
-# Wait till all disconnects are completed
---source include/wait_until_count_sessions.inc
-
-
 --echo #
 --echo # Bug#44521 Prepared Statement: CALL p() - crashes: `! thd->main_da.is_sent' failed et.al.
 --echo #
@@ -449,7 +439,47 @@ DROP FUNCTION f1;
 --disconnect con1
 --disconnect con2
 
-
 --echo # ------------------------------------------------------------------
 --echo # -- End of 5.1 tests
 --echo # ------------------------------------------------------------------
+
+--echo #
+--echo # Test for bug#11763757 "56510: ERROR 42000: FUNCTION DOES NOT EXIST
+--echo # IF NOT-PRIV USER RECONNECTS ".
+--echo #
+--echo # The real problem was that server was unable handle properly stored
+--echo # functions in databases which names contained dot.
+--echo #
+
+connection default;
+
+--disable_warnings
+DROP DATABASE IF EXISTS `my.db`;
+--enable_warnings
+
+create database `my.db`;
+use `my.db`;
+
+CREATE FUNCTION f1(a int) RETURNS INT RETURN a;
+
+--echo # Create new connection.
+connect (addcon, localhost, root,,);
+connection addcon;
+USE `my.db`;
+SELECT f1(1);
+SELECT `my.db`.f1(2);
+
+--echo # Switching to default connection.
+connection default;
+disconnect addcon;
+DROP DATABASE `my.db`;
+
+#
+# Restore global concurrent_insert value. Keep in the end of the test file.
+#
+
+set @@global.concurrent_insert= @old_concurrent_insert;
+
+# Wait till all disconnects are completed
+--source include/wait_until_count_sessions.inc
+


Attachment: [text/bzr-bundle] bzr/dmitry.shulga@oracle.com-20110608134725-09kxjiz0aukwe9vs.bundle
Thread
bzr push into mysql-trunk branch (Dmitry.Shulga:3166 to 3167) Bug#11763757Dmitry Shulga8 Jun