diff options
author | unknown <monty@mysql.com> | 2004-02-11 00:06:46 +0100 |
---|---|---|
committer | unknown <monty@mysql.com> | 2004-02-11 00:06:46 +0100 |
commit | 5b2c3126277a8eedab5bcc8a9b0ce7386ccc3dbe (patch) | |
tree | 927515d304bd661aebdb0e534418caf49d322ada /sql/handler.cc | |
parent | dc792940232f3265e21905cb939853f4db5ebd16 (diff) | |
parent | 65ec6a41b65f26552481be24ac8947c83eeea198 (diff) | |
download | mariadb-git-5b2c3126277a8eedab5bcc8a9b0ce7386ccc3dbe.tar.gz |
Merge with 4.0.18
BitKeeper/etc/ignore:
auto-union
BitKeeper/etc/logging_ok:
auto-union
mysql-test/r/ctype_tis620.result-old:
Merge rename: mysql-test/r/ctype_tis620.result -> mysql-test/r/ctype_tis620.result-old
BUILD/compile-pentium-max:
Auto merged
BitKeeper/etc/config:
Auto merged
Build-tools/Bootstrap:
Auto merged
Build-tools/Do-compile:
Auto merged
configure.in:
Auto merged
mysql-test/t/ctype_tis620.test-old:
Merge rename: mysql-test/t/ctype_tis620.test -> mysql-test/t/ctype_tis620.test-old
Docs/Makefile.am:
Auto merged
client/mysqldump.c:
Auto merged
client/mysqltest.c:
Auto merged
include/my_global.h:
Auto merged
include/my_pthread.h:
Auto merged
include/my_sys.h:
Auto merged
include/myisam.h:
Auto merged
innobase/btr/btr0cur.c:
Auto merged
innobase/ibuf/ibuf0ibuf.c:
Auto merged
innobase/include/dict0dict.h:
Auto merged
innobase/include/srv0srv.h:
Auto merged
innobase/include/ut0mem.h:
Auto merged
innobase/log/log0log.c:
Auto merged
innobase/row/row0ins.c:
Auto merged
innobase/row/row0sel.c:
Auto merged
innobase/srv/srv0start.c:
Auto merged
innobase/ut/ut0mem.c:
Auto merged
myisam/mi_check.c:
Auto merged
myisam/mi_dynrec.c:
Auto merged
myisam/mi_key.c:
Auto merged
myisam/myisam_ftdump.c:
Auto merged
myisam/myisamdef.h:
Auto merged
mysql-test/mysql-test-run.sh:
Auto merged
mysql-test/r/alter_table.result:
Auto merged
mysql-test/r/bdb.result:
Auto merged
mysql-test/r/bigint.result:
Auto merged
mysql-test/r/fulltext.result:
Auto merged
Diffstat (limited to 'sql/handler.cc')
-rw-r--r-- | sql/handler.cc | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/sql/handler.cc b/sql/handler.cc index e9eecabaa84..afeec26f034 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -649,14 +649,23 @@ bool ha_flush_logs() int ha_delete_table(enum db_type table_type, const char *path) { + char tmp_path[FN_REFLEN]; handler *file=get_new_handler((TABLE*) 0, table_type); if (!file) return ENOENT; + if (lower_case_table_names == 2 && !(file->table_flags() & HA_FILE_BASED)) + { + /* Ensure that table handler get path in lower case */ + strmov(tmp_path, path); + casedn_str(tmp_path); + path= tmp_path; + } int error=file->delete_table(path); delete file; return error; } + void ha_store_ptr(byte *buff, uint pack_length, my_off_t pos) { switch (pack_length) { @@ -1134,6 +1143,7 @@ int ha_create_table(const char *name, HA_CREATE_INFO *create_info, { int error; TABLE table; + char name_buff[FN_REFLEN]; DBUG_ENTER("ha_create_table"); if (openfrm(name,"",0,(uint) READ_ALL, 0, &table)) @@ -1144,19 +1154,19 @@ int ha_create_table(const char *name, HA_CREATE_INFO *create_info, if (table.file->table_flags() & HA_DROP_BEFORE_CREATE) table.file->delete_table(name); // Needed for BDB tables } + if (lower_case_table_names == 2 && + !(table.file->table_flags() & HA_FILE_BASED)) + { + /* Ensure that handler gets name in lower case */ + strmov(name_buff, name); + casedn_str(name_buff); + name= name_buff; + } + error=table.file->create(name,&table,create_info); VOID(closefrm(&table)); if (error) - { - if (table.db_type == DB_TYPE_INNODB) - { - /* Creation of InnoDB table cannot fail because of an OS error: - put error as the number */ - my_error(ER_CANT_CREATE_TABLE,MYF(ME_BELL+ME_WAITTANG),name,error); - } - else - my_error(ER_CANT_CREATE_TABLE,MYF(ME_BELL+ME_WAITTANG),name,my_errno); - } + my_error(ER_CANT_CREATE_TABLE,MYF(ME_BELL+ME_WAITTANG),name,error); DBUG_RETURN(error != 0); } |