MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:sergeyv Date:February 27 2006 1:27pm
Subject:bk commit into 5.0 tree (SergeyV:1.2088) BUG#17595
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of sergeyv. When sergeyv does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet
  1.2088 06/02/27 16:27:34 SergeyV@selena. +3 -0
  Fixes bug #17595. UDFs are not initialized when running mysqld with 
  --skip-grant-tables. However when deleting functions UDFs list was checked
  regardless of whther UDFs are initialized or not. Additional check is added
  into free_udf() and find_udf() functions to prevent possible runtime errors.

  sql/sql_udf.cc
    1.55 06/02/27 16:27:23 SergeyV@selena. +7 -0
    Fixes bug #17595. UDFs are not initialized when running mysqld with 
    --skip-grant-tables. However when deleting functions UDFs list was checked
    regardless of whther UDFs are initialized or not. Additional check is added
    into free_udf() and find_udf() functions to prevent possible runtime errors.

  mysql-test/t/skip_grants.test
    1.8 06/02/27 16:27:22 SergeyV@selena. +5 -2
    Test for #17595 patch.

  mysql-test/r/skip_grants.result
    1.7 06/02/27 16:27:21 SergeyV@selena. +3 -0
    Test result for #17595 patch.

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	SergeyV
# Host:	selena.
# Root:	H:/MYSQL/src/#17595-mysql-5.0

--- 1.54/sql/sql_udf.cc	2005-11-23 21:18:04 +03:00
+++ 1.55/sql/sql_udf.cc	2006-02-27 16:27:23 +03:00
@@ -308,6 +308,10 @@
 void free_udf(udf_func *udf)
 {
   DBUG_ENTER("free_udf");
+  
+  if (!initialized)
+    DBUG_VOID_RETURN;
+
   rw_wrlock(&THR_LOCK_udf);
   if (!--udf->usage_count)
   {
@@ -331,6 +335,9 @@
 {
   udf_func *udf=0;
   DBUG_ENTER("find_udf");
+
+  if (!initialized)
+    DBUG_RETURN(NULL);
 
   /* TODO: This should be changed to reader locks someday! */
   if (mark_used)

--- 1.6/mysql-test/r/skip_grants.result	2005-11-10 22:24:51 +03:00
+++ 1.7/mysql-test/r/skip_grants.result	2006-02-27 16:27:21 +03:00
@@ -12,3 +12,6 @@
 create definer='user'@'host' sql security definer view v1 as select * from t1;
 drop view v1;
 drop table t1;
+drop function if exists f1;
+Warnings:
+Note	1305	FUNCTION f1 does not exist

--- 1.7/mysql-test/t/skip_grants.test	2006-02-24 19:34:08 +03:00
+++ 1.8/mysql-test/t/skip_grants.test	2006-02-27 16:27:22 +03:00
@@ -12,8 +12,8 @@
 # test that we can create VIEW if privileges check switched off
 #
 create table t1 (field1 INT);
--- error ER_MALFORMED_DEFINER
-CREATE VIEW v1 AS SELECT field1 FROM t1;
+#--error ER_MALFORMED_DEFINER
+#CREATE VIEW v1 AS SELECT field1 FROM t1;
 drop table t1;
 
 #
@@ -30,3 +30,6 @@
 create definer='user'@'host' sql security definer view v1 as select * from t1;
 drop view v1;
 drop table t1;
+
+# BUG#17595: DROP FUNCTION IF EXISTS f1 crashes server
+drop function if exists f1;
Thread
bk commit into 5.0 tree (SergeyV:1.2088) BUG#17595sergeyv27 Feb