From 9d52381348a5ff15e856d3efc2004bbe36bb39bd Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 29 May 2001 09:29:08 -0400 Subject: Pushing all the Gemini changes above the table handler. BUILD/FINISH.sh: Add Gemini to configure Docs/manual.texi: Added Gemini content to the manual. acinclude.m4: Add Gemini to configure configure.in: Add Gemini to configure include/my_base.h: transaction isolation level READ UNCOMMITTED does not allow updates include/mysqld_error.h: Added new messages for Lock related failures sql/field.cc: Gemini BLOB support - sql/field.h: Gemini BLOB Support sql/ha_gemini.cc: Gemini Table handler sql/ha_gemini.h: Gemini Table handler sql/handler.cc: Added new messages for Lock related failures Provide the ability to turn off recovery for operations like REPAIR TABLE ans ALTER TABLE sql/handler.h: Add a bit to have full text indexes as an option and define the prototype to optionally turn on and off logging sql/lock.cc: Added new messages for Lock related failures sql/share/czech/errmsg.txt: Added new messages for Lock related failures sql/share/danish/errmsg.txt: Added new messages for Lock related failures sql/share/dutch/errmsg.txt: Added new messages for Lock related failures sql/share/english/errmsg.txt: Added new messages for Lock related failures sql/share/estonian/errmsg.txt: Added new messages for Lock related failures sql/share/french/errmsg.txt: Added new messages for Lock related failures sql/share/german/errmsg.txt: Added new messages for Lock related failures sql/share/greek/errmsg.txt: Added new messages for Lock related failures sql/share/hungarian/errmsg.txt: Added new messages for Lock related failures sql/share/italian/errmsg.txt: Added new messages for Lock related failures sql/share/japanese/errmsg.txt: Added new messages for Lock related failures sql/share/korean/errmsg.txt: Added new messages for Lock related failures sql/share/norwegian-ny/errmsg.txt: Added new messages for Lock related failures sql/share/norwegian/errmsg.txt: Added new messages for Lock related failures sql/share/polish/errmsg.txt: Added new messages for Lock related failures sql/share/portuguese/errmsg.txt: Added new messages for Lock related failures sql/share/romanian/errmsg.txt: Added new messages for Lock related failures sql/share/russian/errmsg.txt: Added new messages for Lock related failures sql/share/slovak/errmsg.txt: Added new messages for Lock related failures sql/share/spanish/errmsg.txt: Added new messages for Lock related failures sql/share/swedish/errmsg.txt: Added new messages for Lock related failures sql/sql_base.cc: Avoidlock table overflow issues when doing an alter table on Windows. This is Gemini specific. sql/sql_table.cc: Add a bit to have full text indexes as an option and define the prototype to optionally turn on and off logging BitKeeper/etc/logging_ok: Logging to logging@openlogging.org accepted --- sql/sql_table.cc | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'sql/sql_table.cc') diff --git a/sql/sql_table.cc b/sql/sql_table.cc index ad39b91a5ca..bd7c82d3e26 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -423,6 +423,13 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name, column->field_name); DBUG_RETURN(-1); } + if (key->type == Key::FULLTEXT && + (file->option_flag() & HA_NO_FULLTEXT_KEY)) + { + my_printf_error(ER_WRONG_KEY_COLUMN, ER(ER_WRONG_KEY_COLUMN), MYF(0), + column->field_name); + DBUG_RETURN(-1); + } if (f_is_blob(sql_field->pack_flag)) { if (!(file->option_flag() & HA_BLOB_KEY)) @@ -1678,6 +1685,16 @@ copy_data_between_tables(TABLE *from,TABLE *to, goto err; }; + /* Turn off recovery logging since rollback of an + alter table is to delete the new table so there + is no need to log the changes to it. */ + error = ha_recovery_logging(thd,false); + if(error) + { + error = 1; + goto err; + } + init_read_record(&info, thd, from, (SQL_SELECT *) 0, 1,1); if (handle_duplicates == DUP_IGNORE || handle_duplicates == DUP_REPLACE) @@ -1723,6 +1740,7 @@ copy_data_between_tables(TABLE *from,TABLE *to, if (to->file->activate_all_index(thd)) error=1; + tmp_error = ha_recovery_logging(thd,true); /* Ensure that the new table is saved properly to disk so that we can do a rename @@ -1734,6 +1752,7 @@ copy_data_between_tables(TABLE *from,TABLE *to, if (to->file->external_lock(thd,F_UNLCK)) error=1; err: + tmp_error = ha_recovery_logging(thd,true); free_io_cache(from); *copied= found_count; *deleted=delete_count; -- cgit v1.2.1 From e59d0778ecfb52f367d2bde43542dcde6a9c4aa1 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 1 Jun 2001 04:27:59 +0300 Subject: Added support for symlinked tables. myisamchk: Don't force a repair if the only problem was that the open count wasn't correct. Added missing error messages. include/my_sys.h: Cleanup comments libmysql/Makefile.shared: Added symlink library. myisam/mi_check.c: Added support for symlinked tables myisam/mi_delete_table.c: Added support for symlinked tables myisam/mi_open.c: Added support for symlinked tables myisam/mi_rename.c: Added support for symlinked tables myisam/myisamchk.c: Added support for symlinked tables. Don't force a repair if the only problem was that the open count wasn't correct. pstack/bucomm.c: use mkstemp() instead of mytemp() sql/ha_myisam.cc: Added support for symlinked tables sql/ha_myisam.h: Added support for symlinked tables sql/ha_myisammrg.cc: Added support for symlinked tables sql/handler.cc: Added support for symlinked tables sql/handler.h: Added support for symlinked tables sql/lex.h: Added support for symlinked tables sql/share/czech/errmsg.txt: Added missing error messages sql/share/danish/errmsg.txt: Added missing error messages sql/share/dutch/errmsg.txt: Added missing error messages sql/share/estonian/errmsg.txt: Added missing error messages sql/share/french/errmsg.txt: Added missing error messages sql/share/german/errmsg.txt: Added missing error messages sql/share/greek/errmsg.txt: Added missing error messages sql/share/hungarian/errmsg.txt: Added missing error messages sql/share/italian/errmsg.txt: Added missing error messages sql/share/japanese/errmsg.txt: Added missing error messages sql/share/korean/errmsg.txt: Added missing error messages sql/share/norwegian-ny/errmsg.txt: Added missing error messages sql/share/norwegian/errmsg.txt: Added missing error messages sql/share/polish/errmsg.txt: Added missing error messages sql/share/portuguese/errmsg.txt: Added missing error messages sql/share/romanian/errmsg.txt: Added missing error messages sql/share/russian/errmsg.txt: Added missing error messages sql/share/slovak/errmsg.txt: Added missing error messages sql/share/spanish/errmsg.txt: Added missing error messages sql/share/swedish/errmsg.OLD: Added missing error messages sql/share/swedish/errmsg.txt: Added missing error messages sql/sql_db.cc: Added support for symlinked tables sql/sql_parse.cc: Added support for symlinked tables sql/sql_table.cc: Added support for symlinked tables with ALTER TABLE sql/sql_yacc.yy: Added option to create symlinked tables. --- sql/sql_table.cc | 53 ++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 50 insertions(+), 3 deletions(-) (limited to 'sql/sql_table.cc') diff --git a/sql/sql_table.cc b/sql/sql_table.cc index c23c784ec14..69aa2a2c403 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -1098,7 +1098,8 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name, TABLE *table,*new_table; int error; char tmp_name[80],old_name[32],new_name_buff[FN_REFLEN], - *table_name,*db; + *table_name,*db; + char index_file[FN_REFLEN], data_file[FN_REFLEN]; bool use_timestamp=0; ha_rows copied,deleted; ulonglong next_insert_id; @@ -1120,10 +1121,11 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name, { strmov(new_name_buff,new_name); fn_same(new_name_buff,table_name,3); + // Check if name changed #ifdef FN_LOWER_CASE - if (!my_strcasecmp(new_name_buff,table_name))// Check if name changed + if (!strcmp(db,new_db) && !my_strcasecmp(new_name_buff,table_name)) #else - if (!strcmp(new_name_buff,table_name)) // Check if name changed + if (!strcmp(db,new_db) && !strcmp(new_name_buff,table_name)) #endif new_name=table_name; // No. Make later check easier else @@ -1445,6 +1447,51 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name, if (table->tmp_table) create_info->options|=HA_LEX_CREATE_TMP_TABLE; + /* + Handling of symlinked tables: + If no rename: + Create new data file and index file on the same disk as the + old data and index files. + Copy data. + Rename new data file over old data file and new index file over + old index file. + Symlinks are not changed. + + If rename: + Create new data file and index file on the same disk as the + old data and index files. Create also symlinks to point at + the new tables. + Copy data. + At end, rename temporary tables and symlinks to temporary table + to final table name. + Remove old table and old symlinks + + If rename is made to another database: + Create new tables in new database. + Copy data. + Remove old table and symlinks. + */ + + if (!strcmp(db, new_db)) // Ignore symlink if db changed + { + if (create_info->index_file_name) + { + /* Fix index_file_name to have 'tmp_name' as basename */ + strmov(index_file, tmp_name); + create_info->index_file_name=fn_same(index_file, + create_info->index_file_name, + 1); + } + if (create_info->data_file_name) + { + /* Fix data_file_name to have 'tmp_name' as basename */ + strmov(data_file, tmp_name); + create_info->data_file_name=fn_same(data_file, + create_info->data_file_name, + 1); + } + } + if ((error=mysql_create_table(thd, new_db, tmp_name, create_info, create_list,key_list,1,1))) // no logging -- cgit v1.2.1 From 7c077e68f663e082924a359ecd3cfdfdedd88967 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 2 Jun 2001 00:03:16 +0300 Subject: Fixed bug that caused client to hang because mysqld never did send an error message if the table open or the index creation failed. Updated portuguese error messages. Fix for OS/2 that affected CHECK TABLE. Docs/manual.texi: Changelog. libmysql/errmsg.c: Updated portuguese error messages mysys/my_copy.c: Fix for OS/2 sql/net_pkg.cc: cleanup sql/share/portuguese/errmsg.txt: Updated portuguese error messages sql/slave.cc: Cleanup. Fixed bug that caused client to hang because mysqld never did send an error message if the table open or the index creation failed. sql/sql_parse.cc: Moved handling of 'no_send_ok' to fetch_nx_table. sql/sql_table.cc: Cleanup. --- sql/sql_table.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'sql/sql_table.cc') diff --git a/sql/sql_table.cc b/sql/sql_table.cc index bd7c82d3e26..f287481921d 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -832,13 +832,13 @@ static int prepare_for_restore(THD* thd, TABLE_LIST* table) int lock_retcode; pthread_mutex_lock(&LOCK_open); - if((lock_retcode = lock_table_name(thd, table)) < 0) + if ((lock_retcode = lock_table_name(thd, table)) < 0) { pthread_mutex_unlock(&LOCK_open); DBUG_RETURN(-1); } - if(lock_retcode && wait_for_locked_table_names(thd, table)) + if (lock_retcode && wait_for_locked_table_names(thd, table)) { unlock_table_name(thd, table); pthread_mutex_unlock(&LOCK_open); @@ -846,7 +846,7 @@ static int prepare_for_restore(THD* thd, TABLE_LIST* table) } pthread_mutex_unlock(&LOCK_open); - if(my_copy(src_path, + if (my_copy(src_path, fn_format(dst_path, dst_path,"", reg_ext, 4), MYF(MY_WME))) @@ -860,7 +860,7 @@ static int prepare_for_restore(THD* thd, TABLE_LIST* table) // generate table will try to send OK which messes up the output // for the client - if(generate_table(thd, table, 0)) + if (generate_table(thd, table, 0)) { unlock_table_name(thd, table); thd->net.no_send_ok = save_no_send_ok; @@ -921,7 +921,7 @@ static int mysql_admin_table(THD* thd, TABLE_LIST* tables, // now we should be able to open the partially restored table // to finish the restore in the handler later on - if(!(table->table = reopen_name_locked_table(thd, table))) + if (!(table->table = reopen_name_locked_table(thd, table))) unlock_table_name(thd, table); } @@ -1689,7 +1689,7 @@ copy_data_between_tables(TABLE *from,TABLE *to, alter table is to delete the new table so there is no need to log the changes to it. */ error = ha_recovery_logging(thd,false); - if(error) + if (error) { error = 1; goto err; -- cgit v1.2.1 From fe1842d9ee1a7e51f74ca192d3181968f16a0b29 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 5 Jun 2001 03:38:10 +0300 Subject: Symlinking of tables should not work. Fixed error number handling bug in mysqltest. Fixed that error number from insert delayed is reported correctly. merged new vio code with old violite code. client/mysqltest.c: Fixed bug that error numbers wasn't tested properly. myisam/mi_check.c: Moved initialization of variables to avoid a bug. myisam/mi_create.c: Fixed bug in symlink handling. myisam/mi_test_all.sh: Fixed script so that it works. myisam/myisamchk.c: Removed --no-symlinks option mysql-test/mysql-test-run.sh: Cleaned up error message mysql-test/t/bdb.test: Fixed wrong error numbers mysql-test/t/err000001.test: Fixed wrong error numbers mysql-test/t/innodb.test: Fixed wrong error numbers mysql-test/t/overflow.test: Fixed wrong error numbers mysql-test/t/status.test: Ensure that we are using myisam tables for the lock test. mysys/my_delete.c: cleanup mysys/my_symlink2.c: Added option to not overwrite files when using symlinks. sql/Makefile.am: Moved vio to avoid link error. sql/ha_myisam.cc: Fixed symlink handling. sql/mysqld.cc: Changed --skip-symlinks to --skip-symlink sql/sql_insert.cc: Fixed that error number from insert delayed is reported correctly sql/sql_parse.cc: Fixed symlink handling. sql/sql_table.cc: Fixed symlink handling. vio/vio.c: cleanup vio/viosocket.c: c --- sql/sql_table.cc | 2 ++ 1 file changed, 2 insertions(+) (limited to 'sql/sql_table.cc') diff --git a/sql/sql_table.cc b/sql/sql_table.cc index fdfe6a85c7b..c895c63bcb7 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -1491,6 +1491,8 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name, 1); } } + else + create_info->data_file_name=create_info->index_file_name=0; if ((error=mysql_create_table(thd, new_db, tmp_name, create_info, -- cgit v1.2.1 From bb72939a5bf0d950aec3224292948f01caa986bd Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 6 Jun 2001 15:45:07 -0400 Subject: sql_table.cc re-apply a lost change where we check to see if the sql_table.cc table handler supports temporary tables sql/sql_table.cc: re-apply a lost change where we check to see if the table handler supports temporary tables BitKeeper/etc/logging_ok: Logging to logging@openlogging.org accepted --- sql/sql_table.cc | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'sql/sql_table.cc') diff --git a/sql/sql_table.cc b/sql/sql_table.cc index f287481921d..3fa2bc5d9d3 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -221,6 +221,13 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name, db_options|=HA_OPTION_PACK_RECORD; file=get_new_handler((TABLE*) 0, create_info->db_type); + if ((create_info->options & HA_LEX_CREATE_TMP_TABLE) && + (file->option_flag() & HA_NO_TEMP_TABLES)) + { + my_error(ER_ILLEGAL_HA,MYF(0),table_name); + DBUG_RETURN(-1); + } + /* Don't pack keys in old tables if the user has requested this */ while ((sql_field=it++)) -- cgit v1.2.1 From 765940cb3abccdbfe9e43f2c1116d1e96eb27ae9 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 11 Jun 2001 15:01:28 +0300 Subject: Changed compare in MyISAM to use my_pread() Fixed that @VAR shows all decimals Fixed problem with FLUSH TABLES and LOCK TABLE CREATE ... SELECT now creates keys later Reset AUTO_INCREMENT order if droping AUTO_INCREMENT key Docs/manual.texi: Added MySQL/PostgreSQL comparison isam/_dynrec.c: Fixed wrong compare (not used in MySQL) myisam/mi_dynrec.c: Fixed wrong compare (not used in MySQL). Changed compare to use my_pread() myisam/mi_packrec.c: cleanup mysql-test/r/alter_table.result: Added test for ALTER TABLE mysql-test/r/variables.result: Added test for variables with REAL values. mysql-test/t/alter_table.test: Added test for ALTER TABLE mysql-test/t/variables.test: Added test for variables with REAL values. mysys/my_pread.c: Cleanup sql-bench/Makefile.am: removed extra \ sql-bench/README: Fixed typo. sql/item_func.cc: Fixed that @VAR shows all decimals sql/share/swedish/errmsg.OLD: update sql/sql_base.cc: Fixed problem with FLUSH TABLES and LOCK TABLE sql/sql_insert.cc: CREATE ... SELECT now creates keys later sql/sql_table.cc: Reset AUTO_INCREMENT order if droping AUTO_INCREMENT key. BitKeeper/etc/ignore: Added sql-bench/graph-compare-results to the ignore list BitKeeper/etc/logging_ok: Logging to logging@openlogging.org accepted --- sql/sql_table.cc | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'sql/sql_table.cc') diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 3fa2bc5d9d3..207f9dd324d 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -1233,7 +1233,16 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name, { if (drop->type == Alter_drop::COLUMN && !my_strcasecmp(field->field_name, drop->name)) + { + /* Reset auto_increment value if it was dropped */ + if (MTYP_TYPENR(field->unireg_check) == Field::NEXT_NUMBER && + !(create_info->used_fields & HA_CREATE_USED_AUTO)) + { + create_info->auto_increment_value=0; + create_info->used_fields|=HA_CREATE_USED_AUTO; + } break; + } } if (drop) { -- cgit v1.2.1 From e96fcbcfe97c8d9f0b244071575b5ccc3248d5ff Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 15 Jun 2001 05:03:15 +0300 Subject: Fixed multi-table-delete Optimize fixed length MyISAM rows to use pread/pwrite. BUILD/compile-pentium-debug-max: Also build embedded server libmysqld/lib_vio.c: Add vio_poll_read() myisam/mi_statrec.c: Use pread()/pwrite() instead of seek+read/write mysql-test/r/multi_update.result: Fix multi-table-delete test mysql-test/t/multi_update.test: Fix multi-table-delete test sql/filesort.cc: Fix multi-table-delete sql/mysql_priv.h: Fix multi-table-delete sql/sql_class.h: Fix multi-table-delete sql/sql_delete.cc: Fix multi-table-delete sql/sql_parse.cc: Fix multi-table-delete sql/sql_select.cc: Fix multi-table-delete sql/sql_table.cc: cleanup sql/sql_unions.cc: cleanup sql/sql_yacc.yy: cleanup/ optimize sql/structs.h: Fix multi-table-delete sql/uniques.cc: Fix multi-table-delete --- sql/sql_table.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sql/sql_table.cc') diff --git a/sql/sql_table.cc b/sql/sql_table.cc index a7ef6c30c4c..3988a823e83 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -59,9 +59,9 @@ int mysql_rm_table(THD *thd,TABLE_LIST *tables, my_bool if_exists) VOID(pthread_mutex_lock(&LOCK_open)); pthread_mutex_unlock(&thd->mysys_var->mutex); - if(global_read_lock) + if (global_read_lock) { - if(thd->global_read_lock) + if (thd->global_read_lock) { my_error(ER_TABLE_NOT_LOCKED_FOR_WRITE,MYF(0), tables->real_name); -- cgit v1.2.1 From 4d5dcac35ea0fc25632d17657b3f42af41bd2c7d Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 25 Jun 2001 11:35:22 +0300 Subject: Fixed bug when sorting big files (introduced with multi-table-delete) Changed mysql-test to use --language Cleaned up parameters to filesort() configure.in: Fixed typo mysql-test/install_test_db.sh: Changed test case to use --language mysql-test/mysql-test-run.sh: Changed test case to use --language Fixed that test names are not 'cut'-ed. mysql-test/r/select_found.result: Fixed test case to make it repeatable mysql-test/t/insert.test: Added test of unique key handling mysql-test/t/order_fill_sortbuf.test: Cleaned up test mysql-test/t/select_found.test: Fixed test case to make it repeatable sql/filesort.cc: Fixed bug when sorting big files (introduced with multi-table-delete) cleaned up parameters. sql/mysql_priv.h: Cleaned up parameters to filesort() sql/mysqld.cc: Fixed typo on enum sql/sql_delete.cc: Cleanup sql/sql_select.cc: Cleanup sql/sql_table.cc: Cleanup sql/sql_test.cc: Cleanup sql/sql_update.cc: Cleanup --- sql/sql_table.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sql/sql_table.cc') diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 3988a823e83..b755a4d6327 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -1755,8 +1755,8 @@ copy_data_between_tables(TABLE *from,TABLE *to, if (setup_order(thd, &tables, fields, all_fields, order) || !(sortorder=make_unireg_sortorder(order, &length)) || - (from->found_records = filesort(&from, sortorder, length, - (SQL_SELECT *) 0, 0L, HA_POS_ERROR, + (from->found_records = filesort(from, sortorder, length, + (SQL_SELECT *) 0, 0L, HA_POS_ERROR, &examined_rows)) == HA_POS_ERROR) goto err; -- cgit v1.2.1