From efc69ba2a7c05eebf48af3b0feeea4d3e1ede498 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 7 Nov 2001 00:52:31 +0200 Subject: [PATCH 1/3] ha_innobase.cc: Make database and table names always lower case on Windows sql/ha_innobase.cc: Make database and table names always lower case on Windows --- sql/ha_innobase.cc | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/sql/ha_innobase.cc b/sql/ha_innobase.cc index de796dfa01e..5d364d91bb8 100644 --- a/sql/ha_innobase.cc +++ b/sql/ha_innobase.cc @@ -551,7 +551,7 @@ innobase_init(void) if (!innobase_data_file_path) { - fprintf(stderr, + fprinf(stderr, "Cannot initialize InnoDB as 'innodb_data_file_path' is not set.\n" "If you do not want to use transactional InnoDB tables, add a line\n" "skip-innodb\n" @@ -821,7 +821,8 @@ ha_innobase::bas_ext() const /********************************************************************* Normalizes a table name string. A normalized name consists of the database name catenated to '/' and table name. An example: -test/mytable. */ +test/mytable. On Windows normalization puts both the database name and the +table name always to lower case. */ static void normalize_table_name( @@ -857,6 +858,17 @@ normalize_table_name( memcpy(norm_name, db_ptr, strlen(name) + 1 - (db_ptr - name)); norm_name[name_ptr - db_ptr - 1] = '/'; + +#ifdef __WIN__ + /* Put to lower case */ + + ptr = norm_name; + + while (*ptr != '\0') { + *ptr = tolower(*ptr); + ptr++; + } +#endif } /********************************************************************* From 1119e844b71f4ad8122854c371807819986ce2c0 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 7 Nov 2001 01:14:13 +0200 Subject: [PATCH 2/3] ha_innobase.cc: Fix a typo sql/ha_innobase.cc: Fix a typo --- sql/ha_innobase.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/ha_innobase.cc b/sql/ha_innobase.cc index 5d364d91bb8..093d4e91c30 100644 --- a/sql/ha_innobase.cc +++ b/sql/ha_innobase.cc @@ -551,7 +551,7 @@ innobase_init(void) if (!innobase_data_file_path) { - fprinf(stderr, + fprintf(stderr, "Cannot initialize InnoDB as 'innodb_data_file_path' is not set.\n" "If you do not want to use transactional InnoDB tables, add a line\n" "skip-innodb\n" From e85894c182f4c131b961f87b0392beead3d43a19 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 7 Nov 2001 23:18:12 +0200 Subject: [PATCH 3/3] Fix bug in ALTER TABLE on a TEMPORARY InnoDB table. Docs/manual.texi: Changelog mysql-test/mysql-test-run.sh: Change shutdown to 20 seconds for slow systems mysql-test/r/innodb.result: Testcase for found bug mysql-test/t/innodb.test: Testcase for found bug --- Docs/manual.texi | 2 ++ mysql-test/mysql-test-run.sh | 4 ++-- mysql-test/r/innodb.result | 4 ++++ mysql-test/t/innodb.test | 3 ++- sql/sql_table.cc | 6 ++++++ 5 files changed, 16 insertions(+), 3 deletions(-) diff --git a/Docs/manual.texi b/Docs/manual.texi index 46a62f66eef..0f234fcfd21 100644 --- a/Docs/manual.texi +++ b/Docs/manual.texi @@ -46852,6 +46852,8 @@ Fixed bug with BDB tables and keys on @code{BLOB}'s. Fixed bug in @code{MERGE} tables on OS with 32 bit file pointers. @item Fixed bug in @code{TIME_TO_SEC()} when using negative values. +@item +Fixed core dump bug in @code{ALTER TABLE} on a @code{TEMPORARY} InnoDB table. @end itemize @node News-3.23.44, News-3.23.43, News-3.23.45, News-3.23.x diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh index 9c2cda6108e..de76c6354f5 100644 --- a/mysql-test/mysql-test-run.sh +++ b/mysql-test/mysql-test-run.sh @@ -622,7 +622,7 @@ stop_slave () { if [ x$SLAVE_RUNNING = x1 ] then - $MYSQLADMIN --no-defaults --socket=$SLAVE_MYSOCK -u root -O shutdown_timeout=10 shutdown + $MYSQLADMIN --no-defaults --socket=$SLAVE_MYSOCK -u root -O shutdown_timeout=20 shutdown if [ $? != 0 ] && [ -f $SLAVE_MYPID ] then # try harder! $ECHO "slave not cooperating with mysqladmin, will try manual kill" @@ -644,7 +644,7 @@ stop_master () { if [ x$MASTER_RUNNING = x1 ] then - $MYSQLADMIN --no-defaults --socket=$MASTER_MYSOCK -u root -O shutdown_timeout=10 shutdown + $MYSQLADMIN --no-defaults --socket=$MASTER_MYSOCK -u root -O shutdown_timeout=20 shutdown if [ $? != 0 ] && [ -f $MASTER_MYPID ] then # try harder! $ECHO "master not cooperating with mysqladmin, will try manual kill" diff --git a/mysql-test/r/innodb.result b/mysql-test/r/innodb.result index 9553f78f73c..fddfbfccd33 100644 --- a/mysql-test/r/innodb.result +++ b/mysql-test/r/innodb.result @@ -475,6 +475,10 @@ a 1 2 4 +a b +1 NULL +2 NULL +4 NULL id name value uid 1 one one value 101 3 three three value 103 diff --git a/mysql-test/t/innodb.test b/mysql-test/t/innodb.test index 5530e2b1f54..1f646828324 100644 --- a/mysql-test/t/innodb.test +++ b/mysql-test/t/innodb.test @@ -489,6 +489,8 @@ insert into t1 values (NULL),(NULL),(NULL); delete from t1 where a=3; insert into t1 values (NULL); select * from t1; +alter table t1 add b int; +select * from t1; drop table t1; #Slashdot bug @@ -511,4 +513,3 @@ set insert_id=6; replace into t1 (value,name,uid) values ('other value','two',102); select * from t1; drop table t1; - diff --git a/sql/sql_table.cc b/sql/sql_table.cc index cf788cee05f..725aed390be 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -1509,6 +1509,12 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name, my_free((gptr) new_table,MYF(0)); goto err; } + /* Close lock if this is a transactional table */ + if (thd->lock) + { + mysql_unlock_tables(thd, thd->lock); + thd->lock=0; + } /* Remove link to old table and rename the new one */ close_temporary_table(thd,table->table_cache_key,table_name); if (rename_temporary_table(thd, new_table, new_db, new_name))