List:Commits« Previous MessageNext Message »
From:Sergey Glukhov Date:December 29 2008 1:27pm
Subject:bzr push into mysql-6.0-bugteam branch (Sergey.Glukhov:2827 to 2829)
View as plain text  
 2829 Sergey Glukhov	2008-12-29 [merge]
      5.1-bugteam->6.0-bugteam merge
modified:
  mysql-test/r/csv.result
  mysql-test/t/csv.test
  storage/csv/ha_tina.cc

 2828 Sergey Glukhov	2008-12-29 [merge]
      5.1-bugteam->6.0-bugteam merge
modified:
  mysql-test/r/status.result
  mysql-test/t/status.test
  sql/mysqld.cc

 2827 Sergey Glukhov	2008-12-24
      Bug#38916 Select from I_S.ROUTINES results in "No database selected" error
      The problem is that db name name is not added when
      we create compilable string for the routine.
      The fix is to add db name to this string.
modified:
  mysql-test/r/information_schema.result
  mysql-test/t/information_schema.test
  sql/sp.cc

=== modified file 'mysql-test/r/csv.result'
--- a/mysql-test/r/csv.result	2008-12-10 09:05:18 +0000
+++ b/mysql-test/r/csv.result	2008-12-29 12:50:51 +0000
@@ -5394,4 +5394,17 @@ select * from t1;
 ERROR HY000: File './test/t1.CSV' not found (Errcode: 2)
 unlock tables;
 drop table t1;
+create table t1(a enum ('a') not null) engine=csv;
+insert into t1 values (2);
+Warnings:
+Warning	1265	Data truncated for column 'a' at row 1
+select * from t1 limit 1;
+ERROR HY000: Table 't1' is marked as crashed and should be repaired
+repair table t1;
+Table	Op	Msg_type	Msg_text
+test.t1	repair	Warning	Data truncated for column 'a' at row 1
+test.t1	repair	status	OK
+select * from t1 limit 1;
+a
+drop table t1;
 End of 5.1 tests

=== modified file 'mysql-test/r/status.result'
--- a/mysql-test/r/status.result	2008-10-20 19:13:22 +0000
+++ b/mysql-test/r/status.result	2008-12-29 12:23:22 +0000
@@ -209,6 +209,31 @@ ERROR 42000: SELECT command denied to us
 drop database db37908;
 drop procedure proc37908;
 drop function func37908;
+DROP PROCEDURE IF EXISTS p1;
+DROP FUNCTION IF EXISTS f1;
+CREATE FUNCTION f1() RETURNS INTEGER
+BEGIN
+DECLARE foo INTEGER;
+DECLARE bar INTEGER;
+SET foo=1;
+SET bar=2;
+RETURN foo;
+END $$
+CREATE PROCEDURE p1()
+BEGIN
+SELECT 1;
+END $$
+SELECT f1();
+f1()
+1
+CALL p1();
+1
+1
+SELECT 9;
+9
+9
+DROP PROCEDURE p1;
+DROP FUNCTION f1;
 DROP VIEW IF EXISTS v1;
 CREATE VIEW v1 AS SELECT VARIABLE_NAME AS NAME, CONVERT(VARIABLE_VALUE, UNSIGNED) AS VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS;
 SELECT VALUE INTO @tc FROM v1 WHERE NAME = 'Threads_connected';

=== modified file 'mysql-test/t/csv.test'
--- a/mysql-test/t/csv.test	2008-12-10 09:05:18 +0000
+++ b/mysql-test/t/csv.test	2008-12-29 12:50:51 +0000
@@ -1804,4 +1804,17 @@ unlock tables;
 drop table t1;
 --disconnect con1
 
+#
+# Bug#41441 repair csv table crashes debug server
+#
+# Note: The test should be removed after Bug#33717 is fixed
+
+create table t1(a enum ('a') not null) engine=csv;
+insert into t1 values (2);
+--error ER_CRASHED_ON_USAGE
+select * from t1 limit 1;
+repair table t1;
+select * from t1 limit 1;
+drop table t1;
+
 --echo End of 5.1 tests

=== modified file 'mysql-test/t/status.test'
--- a/mysql-test/t/status.test	2008-10-20 19:13:22 +0000
+++ b/mysql-test/t/status.test	2008-12-29 12:23:22 +0000
@@ -238,6 +238,8 @@ let $tmp_table2 = `show global status li
 --disable_query_log
 eval select substring_index('$rnd_next2',0x9,-1)-substring_index('$rnd_next',0x9,-1) as rnd_diff, substring_index('$tmp_table2',0x9,-1)-substring_index('$tmp_table',0x9,-1) as tmp_table_diff;
 --enable_query_log
+disconnect con1;
+connection default;
 
 # 
 # Bug#30252 Com_create_function is not incremented.
@@ -291,6 +293,43 @@ connection root;
 drop database db37908;
 drop procedure proc37908;
 drop function func37908;
+
+#
+# Bug#41131 "Questions" fails to increment - ignores statements instead stored procs
+#
+connect (con1,localhost,root,,);
+connection con1;
+--disable_warnings
+DROP PROCEDURE IF EXISTS p1;
+DROP FUNCTION IF EXISTS f1;
+--enable_warnings
+DELIMITER $$;
+CREATE FUNCTION f1() RETURNS INTEGER
+BEGIN
+  DECLARE foo INTEGER;
+  DECLARE bar INTEGER;
+  SET foo=1;
+  SET bar=2;
+  RETURN foo;
+END $$
+CREATE PROCEDURE p1()
+  BEGIN
+  SELECT 1;
+END $$
+DELIMITER ;$$
+let $org_queries= `SHOW STATUS LIKE 'Queries'`;
+SELECT f1();
+CALL p1();
+let $new_queries= `SHOW STATUS LIKE 'Queries'`;
+--disable_log
+let $diff= `SELECT SUBSTRING('$new_queries',9)-SUBSTRING('$org_queries',9)`;
+--enable_log
+eval SELECT $diff;
+disconnect con1;
+connection default;
+DROP PROCEDURE p1;
+DROP FUNCTION f1;
+
 # End of 5.1 tests
 
 #

=== modified file 'sql/mysqld.cc'
--- a/sql/mysqld.cc	2008-12-24 14:50:34 +0000
+++ b/sql/mysqld.cc	2008-12-29 12:23:22 +0000
@@ -7265,6 +7265,15 @@ The minimum value for this variable is 4
   {0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
 };
 
+
+static int show_queries(THD *thd, SHOW_VAR *var, char *buff)
+{
+  var->type= SHOW_LONGLONG;
+  var->value= (char *)&thd->query_id;
+  return 0;
+}
+
+
 static int show_net_compression(THD *thd, SHOW_VAR *var, char *buff)
 {
   var->type= SHOW_MY_BOOL;
@@ -7714,6 +7723,7 @@ SHOW_VAR status_vars[]= {
   {"Qcache_queries_in_cache",  (char*) &query_cache.queries_in_cache, SHOW_LONG_NOFLUSH},
   {"Qcache_total_blocks",      (char*) &query_cache.total_blocks, SHOW_LONG_NOFLUSH},
 #endif /*HAVE_QUERY_CACHE*/
+  {"Queries",                  (char*) &show_queries,            SHOW_FUNC},
   {"Questions",                (char*) offsetof(STATUS_VAR, questions), SHOW_LONG_STATUS},
 #ifdef HAVE_REPLICATION
   {"Rpl_status",               (char*) &show_rpl_status,          SHOW_FUNC},

=== modified file 'storage/csv/ha_tina.cc'
--- a/storage/csv/ha_tina.cc	2008-12-10 09:21:13 +0000
+++ b/storage/csv/ha_tina.cc	2008-12-29 12:53:38 +0000
@@ -1449,6 +1449,17 @@ int ha_tina::repair(THD* thd, HA_CHECK_O
     a file, which descriptor is still open. EACCES will be returned
     when trying to delete the "to"-file in my_rename().
   */
+  if (share->tina_write_opened)
+  {
+    /*
+      Data file might be opened twice, on table opening stage and
+      during write_row execution. We need to close both instances
+      to satisfy Win.
+    */
+    if (my_close(share->tina_write_filedes, MYF(0)))
+      DBUG_RETURN(my_errno ? my_errno : -1);
+    share->tina_write_opened= FALSE;
+  }
   if (my_close(data_file,MYF(0)) || my_close(repair_file, MYF(0)) ||
       my_rename(repaired_fname, share->data_file_name, MYF(0)))
     DBUG_RETURN(-1);

Thread
bzr push into mysql-6.0-bugteam branch (Sergey.Glukhov:2827 to 2829)Sergey Glukhov29 Dec