Commit graph

25 commits

Author SHA1 Message Date
Michael Widenius
5a86a61219 Fixed wrong error codes from InnoDB/XtraDB that caused %M to give system dependent error messages (for unknown error code)
- InnoDB now returns handler specific HA_WRONG_CREATE_OPTION instead of MySQL specific ER_ILLEGAL_HA_CREATE_OPTION
- This changes the user level error message from "Unknown error" to "Wrong create options"


mysql-test/r/lowercase_table2.result:
  Updated result file
mysql-test/r/partition_innodb_plugin.result:
  Updated to new error message
mysql-test/r/partition_open_files_limit.result:
  Updated result file
mysql-test/r/row-checksum-old.result:
  Updated to new error message
mysql-test/r/row-checksum.result:
  Updated to new error message
mysql-test/r/symlink.result:
  Updated result file
mysql-test/suite/innodb/r/innodb-create-options.result:
  Updated to new error message
mysql-test/suite/innodb/r/innodb-zip.result:
  Updated to new error message
mysql-test/suite/innodb/r/innodb.result:
  Updated to new error message
storage/innobase/handler/ha_innodb.cc:
  Return HA_WRONG_CREATE_OPTION instead of ER_ILLEGAL_HA_CREATE_OPTION
  This gives more clear and OS indepedent error messages
storage/xtradb/handler/ha_innodb.cc:
  Return HA_WRONG_CREATE_OPTION instead of ER_ILLEGAL_HA_CREATE_OPTION
  This gives more clear and OS indepedent error messages
2012-07-06 19:10:18 +03:00
Georgi Kodinov
c04a6bcbde merge mysql-5.1->mysql-5.5 2011-04-06 18:11:43 +03:00
Georgi Kodinov
5321b3a57a Bug #11758687: 50924: object names not resolved correctly
on lctn2 systems

There was a local variable in get_all_tables() to store the 
"original" value of the database name as it can get lowercased
depending on the lower_case_table_name value.
get_all_tables() iterates over database names and for each 
database iterates over the tables in it.
The "original" db name was assigned in the table names loop.
Thus the first table is ok, but the second and subsequent tables
get the lowercased name from processing the first table.
Fixed by moving the assignment of the original database name
from the inner (table name) to the outer (database name) loop.
Test suite added.
2011-04-04 16:04:15 +03:00
Georgi Kodinov
bbe3e4bdb6 merge 2010-07-21 18:20:29 +03:00
Georgi Kodinov
e24abd9091 Addendum #4 to bug #53095
SHOW DATABASES LIKE ... was not converting to lowercase on comparison as the
documentation is suggesting. 
Fixed it to behave similarly to SHOW TABLES LIKE ... and updated the failing
on MacOSX lowercase_table2 test case.
2010-07-21 18:05:57 +03:00
Magne Mahre
e564e35d06 Bug#54846 main.lowercase_table2 on Mac OSX
This bug is a consequence of WL#5349, as the
default storage engine was changed.

The fix was to explicitly add an ENGINE
clause to a CREATE TABLE statement, to
ensure that we test case preservement on
MyISAM.
2010-06-28 11:23:50 +02:00
Jon Olav Hauglid
84e35f5e1c Backport of revno: 2617.68.3
Followup to Bug#42546 Backup: RESTORE fails, thinking it finds an existing table

This patch updates lowercase_table2.test with the changed error message
CREATE TABLE produces if it fails because it finds an matching TABLE_SHARE 
in the TDC even if the .FRM/.MYD has been removed from disk.

With the changes introduced in Bug#42546, CREATE TABLE uses open_tables()
which will find the TDC entry and fail in open_table_from_share() with
ER_FILE_NOT_FOUND. Before, CREATE TABLE would not use open_tables() and
fail with ER_TABLE_EXISTS_ERROR upon finding the TDC entry in
mysql_create_table_no_lock().
2009-12-10 12:46:16 +01:00
Dmitry Lenev
b20a4f01c3 Fix for bug #44738 "fill_schema_table_from_frm() opens tables without
lowercasing table name".

In lower_case_table_names > 0 mode some queries to I_S left entries
with incorrect key in table definition cache. This wasted memory and
caused some of the further queries to I_S to produce stale results
in cases when table definition was changed by a DDL statement.
Also in combination with similar problem in CREATE TABLE (which also
has peeked into table definition cache using non-normalized key) this
issue led to to spurious ER_TABLE_EXISTS_ERROR errors when one tried
to create a table with the same name as a previously existing but
dropped table (assuming that table name contained characters in upper
case).

This problem occured due to fact that fill_schema_table_from_frm()
was not properly normalizing (lowercasing) database and table names
which it used for lookups in table definition cache.

This fix adds proper normalization to this function. It also solves
similar problem in CREATE TABLE's code by ensuring that it uses
properly normalized version of table name when it peeks into table
definition cache instead of non-normalized one.

mysql-test/r/lowercase_table2.result:
  Added test for #44738 "fill_schema_table_from_frm() opens tables
  without lowercasing table name".
mysql-test/t/lowercase_table2.test:
  Added test for #44738 "fill_schema_table_from_frm() opens tables
  without lowercasing table name".
sql/sql_show.cc:
  Normalize database and table name before using them for looking
  up entry in table definition cache.
sql/sql_table.cc:
  Ensure that CREATE TABLE uses properly normalized version of table
  name when it peeks into table definition cache.
2009-10-09 13:00:18 +04:00
unknown
e30a2aea74 post-merge fix
mysql-test/r/information_schema.result:
  Auto merged
mysql-test/r/lowercase_table2.result:
  Auto merged
sql/item_strfunc.h:
  Auto merged
sql/sql_show.cc:
  Auto merged
mysql-test/t/information_schema.test:
  manual merge
2006-06-14 10:54:56 +05:00
unknown
6c431a5ecd Bug#17661 information_schema.SCHEMATA returns uppercase with lower_case_table_names = 1
fix: return db name for I_S.TABLES(and others) in original letter case.
if mysql starts with lower_case_table_names=1 | 2 then original db name is converted
to lower case(for I_S tables). It happens when we perform add_table_to_list. 
to avoid this we make a copy of original db name and use the copy hereafter.


mysql-test/r/lowercase_table2.result:
  Bug#17661 information_schema.SCHEMATA returns uppercase with lower_case_table_names = 1
  test case
mysql-test/t/lowercase_table2.test:
  Bug#17661 information_schema.SCHEMATA returns uppercase with lower_case_table_names = 1
  test case
2006-06-06 11:25:31 +05:00
unknown
7388e0bda1 Update test result
mysql-test/r/lowercase_table2.result:
  Update test result for "lowercase_tabe2" after push of fix for bug10460
2006-03-06 20:06:56 +01:00
unknown
d211910984 lowercase_table2.test, lowercase_table2.result:
Use IF EXISTS in initiation section


mysql-test/r/lowercase_table2.result:
  Use IF EXISTS in initiation section
mysql-test/t/lowercase_table2.test:
  Use IF EXISTS in initiation section
2005-07-05 17:27:37 +02:00
unknown
280b1c33e3 Cleanup during review of new code
Fixed wrong allocation that could cause buffer overrun when using join cache


myisam/mi_open.c:
  Fixed indentation
mysql-test/r/lowercase_table2.result:
  Drop tables and databases used in the test
mysql-test/t/lowercase_table2.test:
  Drop tables and databases used in the test
mysys/my_fopen.c:
  Cleanup of comments and parameter names
  Simple optimization
  Removed compiler warnings
sql/field.cc:
  Fixed wrong allocation that could cause buffer overrun
sql/mysqld.cc:
  Removed not needed code
sql/set_var.cc:
  Simply code
sql/sql_select.cc:
  Use int2store/int2korr to store length of cached VARCHAR fields
  (Not dependent on type and faster code as we avoid one possible call)
2005-06-21 18:18:58 +03:00
unknown
c23ef5e1f3 Fix problem with handling of lower_case_table_name == 2 when
the case in the FROM and WHERE clauses didn't agree. (Bug #9500)


mysql-test/r/lowercase_table2.result:
  Update results
mysql-test/t/lowercase_table2.test:
  Fix 'DROP TABLE' to not drop tables with the same name.
sql/mysqld.cc:
  Move initialization of table_alias_charset to after we
  have decided what lower_case_table_names should be.
2005-06-08 14:35:16 -07:00
unknown
8ac75806e2 Fix table renaming to not lowercase table names for all storage
engines when lower_case_table_names == 2, as it did previously
for InnoDB and MEMORY. (Bug #9660)


mysql-test/r/lowercase_table2.result:
  Fix results
sql/sql_table.cc:
  Add build_table_path() function to construct the path to
  a table, and use it to replace nearly all of the places
  where this was done with similar code.
  
  Fix mysql_rename_table() to not lowercase the .frm file
  name when lower_case_table_names == 2 and the storage
  engine does not set the HA_FILE_BASED flag (such as InnoDB).
2005-05-25 20:26:40 -07:00
unknown
1de817e9c4 Fix removal of tables from cache when the database they are contained
within is dropped and lower_case_table_names is set. (Bug #8355)


mysql-test/t/lowercase_table2.test:
  Add new regression test
mysql-test/r/lowercase_table2.result:
  Add results for regression test
sql/mysql_priv.h:
  Change remove_db_from_cache() to use char* instead of my_string
sql/sql_base.cc:
  Lowercase database name in remove_db_from_cache so
  that all of the correct entries are removed.
2005-02-08 15:14:14 -08:00
unknown
f332605b1f tT replaced with T1 to be more predictable. 2005-01-25 16:42:16 +04:00
unknown
b7b042689c Test case (bug #7261: Alter table loses temp table with lower_case_table_names=2). 2005-01-25 10:58:30 +04:00
unknown
404730a123 after merge fix
mysql-test/r/lowercase_table2.result:
  results updated
2004-06-27 13:16:19 +02:00
unknown
c6e23c8549 Merge with 4.0 to get the latest bug patches to 4.1
BitKeeper/etc/ignore:
  added sql/mysql_tzinfo_to_sql
BitKeeper/etc/logging_ok:
  auto-union
acinclude.m4:
  Auto merged
extra/perror.c:
  Auto merged
include/mysql.h:
  Auto merged
innobase/include/mach0data.ic:
  Auto merged
innobase/include/mtr0log.h:
  Auto merged
innobase/include/mtr0log.ic:
  Auto merged
innobase/mem/mem0dbg.c:
  Auto merged
innobase/pars/lexyy.c:
  Auto merged
BitKeeper/deleted/.del-4.0.XX-gpl.ipr~f5909a9e9bd8094:
  Auto merged
BitKeeper/deleted/.del-Clients and Tools.fgl~bf0f776883577f02:
  Auto merged
BitKeeper/deleted/.del-Development.fgl~6392ce285e73f5fc:
  Auto merged
mysql-test/mysql-test-run.sh:
  Auto merged
mysql-test/r/innodb_cache.result:
  Auto merged
mysql-test/r/lowercase_table2.result:
  Auto merged
mysql-test/t/innodb_cache.test:
  Auto merged
mysql-test/t/lowercase_table2.test:
  Auto merged
sql/ha_berkeley.cc:
  Auto merged
sql/handler.cc:
  Auto merged
scripts/make_win_src_distribution.sh:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
libmysql/libmysql.c:
  Merge with 4.0
mysql-test/r/bdb.result:
  Merge with 4.0
mysql-test/r/range.result:
  Merge with 4.0
mysql-test/t/bdb.test:
  Merge with 4.0
mysys/hash.c:
  Merge with 4.0
scripts/mysql_install_db.sh:
  Merge with 4.0
sql/field.cc:
  Merge with 4.0
sql/field.h:
  Merge with 4.0
sql/mysql_priv.h:
  Merge with 4.0
sql/sql_handler.cc:
  Merge with 4.0
sql/sql_select.cc:
  Merge with 4.0
sql/sql_table.cc:
  Merge with 4.0
2004-06-25 20:13:05 +03:00
unknown
3db93f8086 lower_case_table_names=2 (Keep case for table names) was not honored
with ALTER TABLE and CREATE/DROP INDEX. (Bug #3109)
Make net_buffer_length visible for mysql clients (Bug #4206)


include/mysql.h:
  Make net_buffer_length visible for mysql clients
libmysql/libmysql.c:
  Make net_buffer_length visible for mysql clients
mysql-test/mysql-test-run.sh:
  Don't give warning for some common 'safe' warnings
mysql-test/r/lowercase_table2.result:
  Test name conversion with ALTER TABLE / CREATE INDEX (Bug #3109)
mysql-test/t/lowercase_table2.test:
  Test name conversion with ALTER TABLE / CREATE INDEX (Bug #3109)
scripts/mysql_install_db.sh:
  Removed not used variable
sql/sql_table.cc:
  lower_case_table_names=2 (Keep case for table names) was not honored
  with ALTER TABLE and CREATE/DROP INDEX. (Bug #3109)
2004-06-23 16:44:34 +03:00
unknown
1bbca272a9 Fixed problems noticed with last build
mysql-test/r/lowercase_table2.result:
  Fixed typo
mysql-test/r/repair.result:
  Portability fix (For OpenBSD)
mysql-test/t/repair.test:
  Portability fix (For OpenBSD)
mysys/my_thr_init.c:
  Fixed crasch with some tests on OpenBSD.
sql/field.cc:
  Don't truncate big values (Caused a core dump on Linux-Alpha for big values)
sql/log.cc:
  More DBUG
2004-04-09 07:12:41 +03:00
unknown
6a868cca91 Fixed warnings from valgrind (not a bug)
Don't add -debug to server version if MYSQL_SERVER_PREFIX is used
Indentation cleanups


myisam/mi_write.c:
  Indentation cleanup
mysql-test/r/lowercase_table2.result:
  Fixed test results
sql/filesort.cc:
  Fixed warnings from valgrind (not a bug)
sql/ha_myisam.cc:
  Indentation cleanup
sql/mysqld.cc:
  Don't add -debug to server if MYSQL_SERVER_PREFIX is used
sql/sql_base.cc:
  Indentation cleanup
sql/sql_show.cc:
  Fixed typo in comment
sql/sql_table.cc:
  Indentation cleanup
2004-04-06 12:13:43 +03:00
unknown
221397cdbe Fixed memory leak in DROP DATABASE when using RAID tables (Bug #2882)
BUILD/compile-pentium-debug-max:
  Added --with-raid
configure.in:
  Removed -DFN_NO_CASE_SENCE for Mac OS X as this is not always true
mysql-test/install_test_db.sh:
  Added --skip-warnings
mysql-test/mysql-test-run.sh:
  Fixes to get --gdb and --ddd to work
mysql-test/r/lowercase_table2.result:
  Test for lower_case_table_names=2 and temporary tables
mysql-test/r/lowercase_table3.result:
  Fixed error message
mysql-test/r/multi_update.result:
  Test of behaviour of multi-table-delete and alias
mysql-test/t/lowercase_table2.test:
  Test for lower_case_table_names=2 and temporary tables
mysql-test/t/lowercase_table3.test:
  Fixed error
mysql-test/t/multi_update.test:
  Test of behaviour of multi-table-delete and alias (Bug #2940)
mysys/mf_iocache.c:
  Renamed _flush_io_cache to my_b_flush_io_cache
sql/ha_myisam.cc:
  Added comment
sql/lock.cc:
  Extra debugging
sql/log.cc:
  New parameter to flush_relay_log_info
sql/log_event.cc:
  New parameter to flush_relay_log_info
sql/mf_iocache.cc:
  Removed not used header files
sql/mysqld.cc:
  More debugging info
  Less warnings when run with --skip-warnings
sql/opt_range.cc:
  More debug information
sql/repl_failsafe.cc:
  New parameter to flush_relay_log_info
sql/slave.cc:
  First start SQL thread, then start IO thread. This fixed a raze condition in SLAVE START (Bug #2921)
  Ensure that we have a lock on the IO thread before flushing a relay log file that. The original code could core dump when a relay log rotated.
sql/slave.h:
  New parameter to flush_relay_log_info
sql/sql_base.cc:
  Added warning
sql/sql_handler.cc:
  Indentation fix
sql/sql_repl.cc:
  New parameter to flush_relay_log_info
sql/sql_select.cc:
  Fixed problem with deleting temporary tables when using lower_case_table_names=2. (Bug #2858)
sql/sql_table.cc:
  Fixed comment
sql/sql_yacc.yy:
  Removed compiler warning
include/my_sys.h:
  Fixed usage of unpack_filename
mysys/mf_pack.c:
  Changed unpack_filename() to return length of result string.
mysys/test_fn.c:
  Fixed usage of unpack_filename
sql/sql_db.cc:
  Fixed memory leak with raid tables
sql/table.cc:
  Fixed usage of unpack_filename
2004-03-10 13:46:11 +02:00
unknown
376fb08072 Some small portability fixes.
Added support for lower_case_table_names=2, which is to be used on case insensitive file systems.
This tells MySQL to preserve the used case of filenames and database names to make it esier to move files between cases sensitive can case insensitive file systems (like Windows and Linux)


client/mysqltest.c:
  Indentation cleanup
include/myisam.h:
  Made some pointers 'const'
mysql-test/mysql-test-run.sh:
  Portability fix for OSX
sql/filesort.cc:
  Safety fix (not needed for current code but needed for 5.0)
sql/ha_berkeley.cc:
  More debugging
  Changed 'create' to return error number
sql/ha_berkeley.h:
  Added HA_FILE_BASED
sql/ha_innodb.cc:
  Added missing DBUG_RETURN
sql/ha_isam.cc:
  Changed create to return error number
sql/ha_isam.h:
  Added HA_FILE_BASED
sql/ha_isammrg.h:
  Added HA_FILE_BASED
sql/ha_myisam.cc:
  Changed create to return error number
sql/ha_myisam.h:
  Added HA_FILE_BASED
sql/ha_myisammrg.cc:
  Changed create to return error number
sql/ha_myisammrg.h:
  Added HA_FILE_BASED
sql/handler.cc:
  Ensure that table engines gets table names in lower case even if we are using lower_case_table_names
  Removed test for DB_TYPE_INNODB by ensuring that create method returns error number.
sql/handler.h:
  Added HA_FILE_BASED
  Made some struct entries 'const'
  Added 'alias' for create to be able to create tables in mixed case on case insensitive file systems
sql/mysql_priv.h:
  Support for lower_case_table_names=2
sql/mysqld.cc:
  Support for lower_case_table_names=2
  Moved test of case insenstive file system after all mutex are created
sql/set_var.cc:
  Support for lower_case_table_names=2
sql/sql_class.h:
  Indentation change
sql/sql_db.cc:
  Support for lower_case_table_names=2
sql/sql_insert.cc:
  Indentation change
sql/sql_parse.cc:
  Support for lower_case_table_names=2
sql/sql_rename.cc:
  Support for lower_case_table_names=2
  Added missing 'unpack_filename' to RENAME which may fix a bug in RENAME TABLE on windows
sql/sql_show.cc:
  If lower_case_table_name=2 is given, show original case in SHOW CREATE TABLE
sql/sql_table.cc:
  Support for lower_case_table_names=2 for DROP TABLE, RENAME TABLE, ALTER TABLE and CREATE TABLE
2003-12-30 13:14:21 +02:00