MySQL Lists are EOL. Please join:

List:Internals« Previous MessageNext Message »
From:msvensson Date:October 13 2005 1:52pm
Subject:bk commit into 4.1 tree (msvensson:1.2490) BUG#93
View as plain text  
Below is the list of changes that have just been committed into a local
4.1 repository of msvensson. When msvensson 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.2490 05/10/13 15:52:22 msvensson@neptunus.(none) +3 -0
  Bug #12698  	abnormal program termination running mysql_client_test
   - Move test for bug#93 from mysql_client_test.c to show_check.test
   - No need for test written in c

  tests/mysql_client_test.c
    1.160 05/10/13 15:52:17 msvensson@neptunus.(none) +0 -92
    Remove test for bug#95 to show_check.test

  mysql-test/t/show_check.test
    1.45 05/10/13 15:52:17 msvensson@neptunus.(none) +13 -0
    Add test case for bug#93, moved from mysql_client_test.c

  mysql-test/r/show_check.result
    1.64 05/10/13 15:52:17 msvensson@neptunus.(none) +7 -0
    Add test case for bug#93, moved from mysql_client_test.c

# 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:	msvensson
# Host:	neptunus.(none)
# Root:	/home/msvensson/mysql/bug12698/my41-bug12698

--- 1.63/mysql-test/r/show_check.result	2005-07-07 14:43:31 +02:00
+++ 1.64/mysql-test/r/show_check.result	2005-10-13 15:52:17 +02:00
@@ -513,3 +513,10 @@
   KEY `c2` USING BTREE (`c2`)
 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
 DROP TABLE t1;
+flush tables;
+SHOW TABLE STATUS like 't1';
+Name	Engine	Version	Row_format	Rows	Avg_row_length	Data_length	Max_data_length	Index_length	Data_free	Auto_increment	Create_time	Update_time	Check_time	Collation	Checksum	Create_options	Comment
+t1	NULL	NULL	NULL	NULL	#	#	#	#	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	Incorrect information in file: './test/t1.frm'
+show create table t1;
+ERROR HY000: Incorrect information in file: './test/t1.frm'
+drop table t1;

--- 1.44/mysql-test/t/show_check.test	2005-07-28 02:21:49 +02:00
+++ 1.45/mysql-test/t/show_check.test	2005-10-13 15:52:17 +02:00
@@ -378,4 +378,17 @@
 SHOW CREATE TABLE t1;
 DROP TABLE t1;
 
+# Test for BUG#93: 4.1 protocl crash on corupted frm and SHOW TABLE STATUS
+
+flush tables;
+
+# Create a junk frm file on disk
+system echo "this is a junk file for test" >> var/master-data/test/t1.frm ;
+--replace_column 6 # 7 # 8 # 9 #
+SHOW TABLE STATUS like 't1';
+--error 1033
+show create table t1;
+drop table t1;
+
+
 # End of 4.1 tests

--- 1.159/tests/mysql_client_test.c	2005-10-13 13:37:04 +02:00
+++ 1.160/tests/mysql_client_test.c	2005-10-13 15:52:17 +02:00
@@ -6899,97 +6899,6 @@
 }
 #endif /* EMBEDDED_LIBRARY */
 
-/*
-  Test a crash when invalid/corrupted .frm is used in the
-  SHOW TABLE STATUS
-  bug #93 (reported by serg@stripped).
-*/
-
-static void test_frm_bug()
-{
-  MYSQL_STMT *stmt;
-  MYSQL_BIND bind[2];
-  MYSQL_RES  *result;
-  MYSQL_ROW  row;
-  FILE       *test_file;
-  char       data_dir[FN_REFLEN];
-  char       test_frm[FN_REFLEN];
-  int        rc;
-
-  myheader("test_frm_bug");
-
-  mysql_autocommit(mysql, TRUE);
-
-  rc= mysql_query(mysql, "drop table if exists test_frm_bug");
-  myquery(rc);
-
-  rc= mysql_query(mysql, "flush tables");
-  myquery(rc);
-
-  stmt= mysql_simple_prepare(mysql, "show variables like 'datadir'");
-  check_stmt(stmt);
-
-  rc= mysql_stmt_execute(stmt);
-  check_execute(stmt, rc);
-
-  bind[0].buffer_type= MYSQL_TYPE_STRING;
-  bind[0].buffer= data_dir;
-  bind[0].buffer_length= FN_REFLEN;
-  bind[0].is_null= 0;
-  bind[0].length= 0;
-  bind[1]= bind[0];
-
-  rc= mysql_stmt_bind_result(stmt, bind);
-  check_execute(stmt, rc);
-
-  rc= mysql_stmt_fetch(stmt);
-  check_execute(stmt, rc);
-
-  if (!opt_silent)
-    fprintf(stdout, "\n data directory: %s", data_dir);
-
-  rc= mysql_stmt_fetch(stmt);
-  DIE_UNLESS(rc == MYSQL_NO_DATA);
-
-  strxmov(test_frm, data_dir, "/", current_db, "/", "test_frm_bug.frm", NullS);
-
-  if (!opt_silent)
-    fprintf(stdout, "\n test_frm: %s", test_frm);
-
-  if (!(test_file= my_fopen(test_frm, (int) (O_RDWR | O_CREAT), MYF(MY_WME))))
-  {
-    fprintf(stdout, "\n ERROR: my_fopen failed for '%s'", test_frm);
-    fprintf(stdout, "\n test cancelled");
-    exit(1);
-  }
-  fprintf(test_file, "this is a junk file for test");
-
-  rc= mysql_query(mysql, "SHOW TABLE STATUS like 'test_frm_bug'");
-  myquery(rc);
-
-  result= mysql_store_result(mysql);
-  mytest(result);/* It can't be NULL */
-
-  rc= my_process_result_set(result);
-  DIE_UNLESS(rc == 1);
-
-  mysql_data_seek(result, 0);
-
-  row= mysql_fetch_row(result);
-  mytest(row);
-
-  if (!opt_silent)
-    fprintf(stdout, "\n Comment: %s", row[17]);
-  DIE_UNLESS(row[17] != 0);
-
-  mysql_free_result(result);
-  mysql_stmt_close(stmt);
-
-  my_fclose(test_file, MYF(0));
-  mysql_query(mysql, "drop table if exists test_frm_bug");
-}
-
-
 /* Test DECIMAL conversion */
 
 static void test_decimal_bug()
@@ -11975,7 +11884,6 @@
 #ifndef EMBEDDED_LIBRARY
   { "test_prepare_grant", test_prepare_grant },
 #endif
-  { "test_frm_bug", test_frm_bug },
   { "test_explain_bug", test_explain_bug },
   { "test_decimal_bug", test_decimal_bug },
   { "test_nstmts", test_nstmts },
Thread
bk commit into 4.1 tree (msvensson:1.2490) BUG#93msvensson13 Oct