Commit graph

552 commits

Author SHA1 Message Date
unknown
f41b7bca6c Merge
mysql-test/r/create.result:
  Auto merged
mysql-test/t/create.test:
  Auto merged
sql/sql_table.cc:
  SCCS merged
2006-01-16 16:21:41 +01:00
unknown
2a1ae3a5e3 A fix and a test case for Bug#14410 "Crash in Enum or Set type in
CREATE TABLE and PS/SP": make sure that 'typelib' object for
ENUM values and 'Item_string' object for DEFAULT clause are 
created in the statement memory root.


mysql-test/r/ps.result:
  Test results has been fixed (Bug#14410)
mysql-test/t/ps.test:
  A test case for Bug#14410 "Crash in Enum or Set type in CREATE 
  TABLE and PS/SP"
sql/mysql_priv.h:
  typelib() function declaration has been changed.
sql/sql_table.cc:
  Supply the statement memory root to use in typelib() and
  safe_charset_converter() functions to ensure that objects 
  created during the first execution of CREATE TABLE statement
  are allocated in persistent memory of the statement.
sql/table.cc:
  Change typelib() function to require MEM_ROOT.
2005-11-25 13:25:31 +03:00
unknown
faaf53d966 Merge mysql.com:/home/mydev/mysql-4.0-4000
into  mysql.com:/home/mydev/mysql-4.1-4100


mysql-test/r/handler.result:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_class.cc:
  Auto merged
mysql-test/t/handler.test:
  Bug#14397 - OPTIMIZE TABLE with an open HANDLER causes a crash
  Manual merge.
sql/sql_handler.cc:
  Bug#14397 - OPTIMIZE TABLE with an open HANDLER causes a crash
  Manual merge.
sql/sql_table.cc:
  Bug#14397 - OPTIMIZE TABLE with an open HANDLER causes a crash
  Manual merge.
2005-11-15 18:09:40 +01:00
unknown
f76ff56512 BUG#14480: post-fix: use the default field value from CREATE list too. 2005-11-09 09:34:46 +03:00
unknown
467deb4cb7 BUG#14480, attempt2: In CREATE ... SELECT ..., don't count the same field twice
when calculating table->null_fields.


mysql-test/r/create.result:
  Testcase for BUG#14480
mysql-test/t/create.test:
  Testcase for BUG#14480
sql/sql_table.cc:
  BUG#14480: For CREATE ... SELECT ... a field list passed to mysql_prepare_table() contains
  instances of create_field for both create-list and select-list. mysql_prepare_table() 
  matches elements that refer to the same field, and joins them together. When the "join"  
  is performed, both of create_field structures has already been counted in "null_fields". 
  
  This fix makes sure that "null_fields" contains the correct value after two create_field 
  structures have been joined.
2005-11-07 09:23:43 +03:00
unknown
7d183320b0 Bug#14397 - OPTIMIZE TABLE with an open HANDLER causes a crash
Version for 4.0.
It fixes two problems:
1. The cause of the bug was that we did not check the table version for
   the HANDLER ... READ commands. We did not notice when a table was
   replaced by a new one. This can happen during ALTER TABLE, REPAIR
   TABLE, and OPTIMIZE TABLE (there might be more cases). I call the fix
   for this problem "the primary bug fix".
2. mysql_ha_flush() was not always called with a locked LOCK_open.
   Though the function comment clearly said it must.
   I changed the code so that the locking is done when required. I call
   the fix for this problem "the secondary fix".


mysql-test/r/handler.result:
  Bug#14397 - OPTIMIZE TABLE with an open HANDLER causes a crash
  The test result.
mysql-test/t/handler.test:
  Bug#14397 - OPTIMIZE TABLE with an open HANDLER causes a crash
  The test case.
sql/mysql_priv.h:
  Bug#14397 - OPTIMIZE TABLE with an open HANDLER causes a crash
  Changed a definition for the secondary fix.
sql/sql_base.cc:
  Bug#14397 - OPTIMIZE TABLE with an open HANDLER causes a crash
  Changed function calls for the secondary fix.
sql/sql_class.cc:
  Bug#14397 - OPTIMIZE TABLE with an open HANDLER causes a crash
  Changed a function call for the secondary fix.
sql/sql_handler.cc:
  Bug#14397 - OPTIMIZE TABLE with an open HANDLER causes a crash
  The first two diffs make the primary bug fix.
  The rest is for the secondary fix.
sql/sql_table.cc:
  Bug#14397 - OPTIMIZE TABLE with an open HANDLER causes a crash
  Changed function calls for the secondary fix.
2005-11-03 18:24:12 +01:00
unknown
115bf43602 BUG#14139: When handling "CREATE TABLE(field_X type_spec,...) SELECT smth AS field_X, ...."
avoid multiplying length of field_X by charset->mbmaxlen twice when calculating space 
required for field_X in the new table.


mysql-test/r/create.result:
  Testcase for BUG#14139
mysql-test/t/create.test:
  Testcase for BUG#14139
sql/field.cc:
  BUG#14139: Make create_length_to_internal_length() save length-in-characters in 
  create_field::chars_length.
sql/field.h:
  BUG#14139: Add create_length::chars_length where we save length-in-characters, added comments.
sql/sql_table.cc:
  BUG#14139: When handling "CREATE TABLE(field_X type_spec,...) SELECT smth AS field_X, ...."
  we get two instances of create_field: (1) is occurence of field_X in create list, and (2) is
  in select list. If we figure they both refer to the same field, we "join" them according to
  some rule that is not explicitly specified anywhere.
  When we do this "join", create_field::length already contains length-in-bytes for both, so
  when we transfer field length (in characters) from (1) to (2), use length-in-characters that
  we have saved in create_length::chars_length.
2005-10-26 00:56:17 +04:00
unknown
f147d73c87 Merge ahristov@bk-internal.mysql.com:/home/bk/mysql-4.1
into lmy004.:/work/mysql-4.1-bug12913


mysql-test/r/create.result:
  Auto merged
mysql-test/t/create.test:
  Auto merged
sql/sql_table.cc:
  Auto merged
2005-09-20 06:55:23 +03:00
unknown
63080dc200 Fix for bug #6008: MySQL does not create warnings when creating database and using IF NOT EXISTS
produce warning for 'create database if not exists' if database exists
  do not update database options in this case  
  produce warning for 'create table if not exists' if table exists



mysql-test/r/create.result:
  Fix for bug #6008: MySQL does not create warnings when creating database and using IF NOT EXISTS
    updated test case result
mysql-test/r/temp_table.result:
  Fix for bug #6008: MySQL does not create warnings when creating database and using IF NOT EXISTS
    updated test case result
mysql-test/r/warnings.result:
  Fix for bug #6008: MySQL does not create warnings when creating database and using IF NOT EXISTS
    updated test case result
mysql-test/t/create.test:
  Fix for bug #6008: MySQL does not create warnings when creating database and using IF NOT EXISTS
    test case
sql/sql_db.cc:
  Fix for bug #6008: MySQL does not create warnings when creating database and using IF NOT EXISTS
    produce warning for 'create database if not exists' if database exists
    do not update database options in this case
sql/sql_table.cc:
  Fix for bug #6008: MySQL does not create warnings when creating database and using IF NOT EXISTS
    produce warning for 'create table if not exists' if table exists
2005-09-12 17:09:19 +05:00
unknown
11bd1f871a fix for bug#12913
(Simple SQL can crash server or connection)
(not initialized member leads to server crash)


mysql-test/r/create.result:
  result of test for bug #12913
mysql-test/t/create.test:
  test for bug#12913
  (Simple SQL can crash server or connection)
sql/sql_table.cc:
  copy the interval pointer too or a bit later
  dereferencing of this pointer being 0x0 will crash the server
  (see bug #12913)
2005-09-01 00:13:02 +02:00
unknown
aa4820af40 Fix incorrect spellings of "dropped" in source and tests. (Bug #12828)
include/my_alloc.h:
  Fix incorrect spelling
mysql-test/t/rpl000009.test:
  Fix incorrect spelling
mysql-test/t/system_mysql_db_fix.test:
  Fix incorrect spelling
sql/sql_table.cc:
  Fix incorrect spelling
tests/mysql_client_test.c:
  Fix incorrect spelling
2005-08-30 12:24:37 -07:00
unknown
ea36375027 Bug#12296 - CHECKSUM TABLE reports 0 for the table
Skipping deleted records instead of breaking the loop
during checksum calculation.


mysql-test/r/myisam.result:
  Bug#12296 - CHECKSUM TABLE reports 0 for the table
  The test result.
mysql-test/t/myisam.test:
  Bug#12296 - CHECKSUM TABLE reports 0 for the table
  The test case.
2005-08-29 17:08:41 +02:00
unknown
e2c29343f8 after pull cleanup
configure.in:
  don't be too restrictive
mysql-test/r/rpl_drop_db.result:
  test case cleanup
mysql-test/t/rpl_drop_db.test:
  test case cleanup
2005-08-22 13:20:02 +04:00
unknown
4652c6b053 updated patch for BUG#4680 (incomplete DROP DATABASE breaking replication).
We binlog the DROP TABLE for each table that was actually dropped. Per Sergei's 
suggestion a fixed buffer for the DROP TABLE query is pre-allocated from THD pool, and 
logging now is done in batches - new batch is started if the buffer becomes full.
Reduced memory usage by reusing the table list instead of accumulating a list of 
dropped table names. Also fixed the problem if the table was not actually dropped, eg
due to permissions. Extended the test case to make sure batched query 
logging does work.  


mysql-test/r/rpl_drop_db.result:
  test for query buffer overrun
mysql-test/t/rpl_drop_db.test:
  test for query buffer overrun
sql/mysql_priv.h:
  updated patch for BUG#4680 (incomplete DROP DATABASE breaking replication)
BitKeeper/etc/ignore:
  Added support-files/MacOSX/postflight support-files/MacOSX/preflight to the ignore list
sql/sql_db.cc:
  updated patch for BUG#4680 (incomplete DROP DATABASE breaking replication)
sql/sql_table.cc:
  updated patch for BUG#4680 (incomplete DROP DATABASE breaking replication)
sql/table.h:
  updated patch for BUG#4680 (incomplete DROP DATABASE breaking replication)
2005-08-18 21:40:14 -06:00
unknown
ec657e8d2a patch for BUG#4680 - drop database breaking replication if there were extra files
in the database directory on the master


mysql-test/r/rpl_drop_db.result:
  New BitKeeper file ``mysql-test/r/rpl_drop_db.result''
mysql-test/t/rpl_drop_db.test:
  New BitKeeper file ``mysql-test/t/rpl_drop_db.test''
2005-08-03 18:08:20 -06:00
unknown
34b340c4dd Review of new code:
Change argument order to be database, tablename for some functions


sql/lock.cc:
  Remove not needed block
sql/mysql_priv.h:
  Change argument order to be database, tablename (like in most other functions)
sql/sql_table.cc:
  Change argument order to be database, tablename (like in most other functions)
  Make 'flags' inline
sql/table.cc:
  Change argument order to be database, tablename (like in most other functions)
sql/unireg.cc:
  Change argument order to be database, tablename (like in most other functions)
2005-07-27 13:05:30 +03:00
unknown
4198410528 Fix error message generated when trying to create a table in a
non-existent database. (Bug #10407)


mysql-test/r/create.result:
  Update results
mysql-test/t/create.test:
  Update error numbers
sql/mysql_priv.h:
  Adjust some other function signature so table and db information
  is passed down into create_frm().
sql/sql_table.cc:
  Check for database not existing after hitting an error when
  copying the .frm file for 'CREATE TABLE ... LIKE ...', and
  pass table and db name into rea_create_table().
sql/table.cc:
  Generate specific error message when .frm creation fails because
  the database does not exist.
sql/unireg.cc:
  Pass database and table name down into create_frm().
2005-07-21 20:08:54 -07:00
unknown
31ebc6ef71 Fix merge 2005-07-20 22:30:34 -04:00
unknown
a3fe765249 Merge mronstrom@bk-internal.mysql.com:/home/bk/mysql-4.0
into  c-450ae253.1238-1-64736c10.cust.bredbandsbolaget.se:/home/pappa/mysql-4.1


include/thr_lock.h:
  Auto merged
mysys/thr_lock.c:
  Auto merged
sql/lock.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_table.cc:
  Manual merge after 4.0 fix
2005-07-20 21:58:33 -04:00
unknown
af1dfb613b Bug #10600 After review fixes
sql/lock.cc:
  Used flags immediately in call
sql/mysql_priv.h:
  Added RTFC (short for remove_table_from_cache)
  for constants and used hex syntax to clarify it is bits
  in the flags
sql/sql_base.cc:
  Use flags parameter immediately and use flags immediately in call
  Change to other variant of eternal loop variant
sql/sql_table.cc:
  Use flags immediately in call
2005-07-20 21:19:01 +02:00
unknown
6d29b23b15 Bug #10600
remove_table_from_cache fails to signal other thread and gets
blocked when other thread also gets blocked


include/thr_lock.h:
  Report if any threads was signalled
mysys/thr_lock.c:
  Report if any threads was signalled
sql/lock.cc:
  Report if any threads was signalled
  Use new interface for remove_table_from_cache
sql/mysql_priv.h:
  New interface for remove_table_from_cache
  + mysql_lock_abort_for_thread
sql/sql_base.cc:
  Use new interface of remove_table_cache
  Rewrote remove_table_from_cache to fix bug
sql/sql_table.cc:
  Use new interface of remove_table_from_cache
2005-07-19 00:29:19 +02:00
unknown
86cb32b7b0 Merge abarkov@bk-internal.mysql.com:/home/bk/mysql-4.1
into  mysql.com:/usr/home/bar/mysql-4.1.num-conv


mysql-test/r/ctype_utf8.result:
  Auto merged
mysql-test/t/ctype_utf8.test:
  Auto merged
sql/item.cc:
  Auto merged
sql/item.h:
  Auto merged
sql/sql_table.cc:
  Auto merged
2005-07-14 10:46:15 +05:00
unknown
4a2af29fe7 ctype_utf8.result:
adding test case
sql_table.cc:
  sql_table.cc:
  - do not create a new item when charsets are the same
  - return ER_INVALID_DEFAULT if default value cannot
    be converted into the column character set.
item.cc:
  - Allow conversion not only to Unicode,
    but also to and from "binary".
  - Adding safe_charset_converter() for Item_num
    and Item_varbinary, returning a fixed const Item.


sql/item.cc:
  - Allow conversion not only to Unicode,
    but also to and from "binary".
  - Adding safe_charset_converter() for Item_num
    and Item_varbinary, returning a fixed const Item.
sql/sql_table.cc:
  sql_table.cc:
  - do not create a new item when charsets are the same
  - return ER_INVALID_DEFAULT if default value cannot
    be converted into the column character set.
mysql-test/r/ctype_utf8.result:
  adding test case
2005-07-13 13:00:17 +05:00
unknown
128712c04a Merge mysql.com:/home/jimw/my/mysql-4.1-11440
into  mysql.com:/home/jimw/my/mysql-4.1-clean


sql/sql_table.cc:
  Auto merged
2005-07-05 12:54:12 -07:00
unknown
76d444fcb6 Portability fixes
Fixes while reviewing new pushed code
NULL as argument to encrypt/decrypt should return NULL without a warning


client/mysqldump.c:
  Cleanup
  Ensure we free allocated memory
  Portability fixes
client/mysqltest.c:
  Cleanup of code during review
  Portability fixes (Don't use 'bool')
mysql-test/r/func_encrypt.result:
  NULL as argument to encrypt/decrypt should return NULL without a warning
mysql-test/r/func_encrypt_nossl.result:
  Added test of NULL argument
mysql-test/t/func_encrypt_nossl.test:
  Added test of NULL argument
sql/handler.cc:
  Cleanup during code review
sql/item_strfunc.cc:
  NULL as argument to encrypt/decrypt should return NULL without a warning
sql/sql_parse.cc:
  Fix wrong merge (fix was not needed as the previous code was reverted)
sql/sql_table.cc:
  Removed extra new line
2005-06-27 20:31:00 +03:00
unknown
bedb96f2aa Restore creation of files for temporary tables in the tmpdir,
which was broken by an earlier bug fix. (Bug #11440)


sql/sql_table.cc:
  Restore code to generate temporary tables in
  tmpdir
2005-06-21 11:25:51 -07:00
unknown
29397de1e0 Merge neptunus.(none):/home/msvensson/mysql/mysql-4.1
into neptunus.(none):/home/msvensson/mysql/bug10365


sql/ha_ndbcluster.cc:
  Auto merged
sql/handler.cc:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_table.cc:
  Auto merged
2005-06-20 13:08:45 +02:00
unknown
c995109b69 Bug#11028 Crash on create table like
Report error instead of crashing


mysql-test/r/create.result:
  Test for bug 11028
mysql-test/t/create.test:
  Test for bug 11028
sql/sql_table.cc:
  fix for null db name
2005-06-09 16:06:15 +01:00
unknown
09944efd71 BUG#10365 Cluster handler uses non-standard error codes
- Added better error messages when trying to open a table that can't be discovered or unpacked. The most likely cause of this is that it does not have any frm data, probably since it has been created from NdbApi or is a NDB system table.
 - Separated functionality that was in ha_create_table_from_engine into two functions. One that checks if the table exists and another one that tries to create the table from the engine.


mysql-test/r/ndb_autodiscover.result:
  Add tests for reading from a table that can't be discovered(SYSTAB_0)
  Discovery is not performed during create table anymore.
mysql-test/t/ndb_autodiscover.test:
  Add tests for reading from a table that can't be discovered(SYSTAB_0)
  Discovery is not performed during create table anymore.
ndb/test/ndbapi/create_tab.cpp:
  Set connectstring before creating Ndb object.
sql/ha_ndbcluster.cc:
  Rename and use the function ndbcluster_table_exists_in_engine.
  Correct return valu from ndbcluster_discover
  Remove old code "ndb_discover_tables"
sql/ha_ndbcluster.h:
  Rename function ndbcluster_table_exists to ndb ndbcluster_table_exists_in_engine
sql/handler.cc:
  Update comment of ha_create_table_from_engine
  Remove parameter create_if_found from ha_create_table_from_engine, the function ha_table_exists_in_engine is now used toi check if table is found in engine.
  Cleanup return codes from ha_create_table_from_engine.
  Change name of ha_table_exists to ha_table_exists_in_engine, update comment and returne codes.
sql/handler.h:
  Remove paramter create_if_cound from  ha_create_table_from_engine
  Rename ha_table_exists to ha_table_exists_in_engine
sql/sql_base.cc:
  Use the function ha_table_exists_in_engine to detect if table exists in enegine. 
  If it exists, call function ha_create_table_from_engine to try and create it.
  If create of table fails, set correct error message.
sql/sql_table.cc:
  Add comments, remove parameter create_if_found to ha_create_table_from_engine.
  When dropping a table, try to discover it from engine. If discover fails, use same error message as if the table didn't exists. 
  Maybe another message should be displayed here, ex: "Table could not be dropped, unpack failed"
  
  When creating a new table, use ha_table_exists_in_engine to check if a table with the given name already exists.
2005-06-08 13:31:59 +02:00
unknown
72dd44b9de Move USE_PRAGMA_IMPLEMENTATION to proper place
Ensure that 'null_value' is not accessed before val() is called in FIELD() functions
Fixed initialization of key maps. This fixes some problems with keys when you have more than 64 keys
Fixed that ROLLUP don't always create a temporary table. This fix ensures that func_gconcat.test results are now predictable


mysql-test/r/func_gconcat.result:
  Move innodb specific test to innodb.test
  Changed table name r2 -> t2
  More test to see how ROLLUP was optimized
mysql-test/r/innodb.result:
  Moved test here form func_gconcat
mysql-test/r/olap.result:
  New test results after optimization
mysql-test/t/func_gconcat.test:
  Move innodb specific test to innodb.test
  Changed table name r2 -> t2
  More test to see how ROLLUP was optimized
mysql-test/t/innodb.test:
  Moved test here form func_gconcat
sql/field.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/ha_berkeley.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/ha_blackhole.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/ha_heap.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/ha_innodb.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/ha_isam.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/ha_isammrg.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/ha_myisam.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/ha_myisammrg.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/ha_ndbcluster.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/handler.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/hash_filo.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/item.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/item_cmpfunc.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/item_func.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
  Ensure that 'null_value' is not accessed before val() is called
sql/item_geofunc.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/item_strfunc.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/item_subselect.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/item_sum.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/item_timefunc.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/item_uniq.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/log_event.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/mysql_priv.h:
  Change key_map_full to not be const as we are giving it a proper value on startup
sql/mysqld.cc:
  Move key_map variables here and initialize key_map_full properly
sql/opt_range.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/opt_range.h:
  Fix that test_quick_select() works with any ammount of keys
sql/procedure.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/protocol.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/protocol_cursor.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/set_var.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/sql_analyse.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/sql_class.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/sql_crypt.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/sql_insert.cc:
  Fixed that max_rows is ulong
sql/sql_list.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/sql_map.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/sql_olap.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/sql_select.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
  Fixed that ROLLUP don't have to always create a temporary table
  Added new argument to remove_const() to make above possible
  Fixed some errors that creapt up when we don't always do a temporary table for ROLLUP
sql/sql_string.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/sql_table.cc:
  Simple optimizations
  Fixed wrong checking of build_table_path() in undef-ed code
sql/sql_udf.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/sql_yacc.yy:
  removed extra {}
2005-06-03 23:46:03 +03:00
unknown
4e19af2716 Fix compile error when HAVE_BERKELEY_DB
sql/sql_table.cc:
  Add missing argument
2005-06-01 16:03:41 -07:00
unknown
be80410947 Merge mysql.com:/home/jimw/my/mysql-4.1-9660
into  mysql.com:/home/jimw/my/mysql-4.1-clean


sql/sql_table.cc:
  Auto merged
2005-06-01 13:02:26 -07:00
unknown
dd1168a34f Merge mysql.com:/home/jimw/my/mysql-4.1-8135
into  mysql.com:/home/jimw/my/mysql-4.1-clean


sql/sql_table.cc:
  Auto merged
2005-06-01 12:59:11 -07:00
unknown
57d4adf60c Bug#10224 - ANALYZE TABLE crashing with simultaneous CREATE ... SELECT statement.
Hand merged from 4.0.


sql/lock.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/sql_acl.cc:
  Auto merged
sql/sql_handler.cc:
  Auto merged
sql/sql_table.cc:
  Auto merged
2005-05-31 19:37:24 +02:00
unknown
cf2188ca39 Bug#10224 - ANALYZE TABLE crashing with simultaneous CREATE ... SELECT statement.
1.) Added a new option to mysql_lock_tables() for ignoring FLUSH TABLES.
Used the new option in create_table_from_items().
It is necessary to prevent the SELECT table from being reopend.
It would get new storage assigned for its fields, while the
SELECT part of the command would still use the old (freed) storage.
2.) Protected the CREATE TABLE and CREATE TABLE ... SELECT commands
against a global read lock. This prevents a deadlock in
CREATE TABLE ... SELECT in conjunction with FLUSH TABLES WITH READ LOCK
and avoids the creation of new tables during a global read lock.
3.) Replaced set_protect_against_global_read_lock() and
unset_protect_against_global_read_lock() by
wait_if_global_read_lock() and start_waiting_global_read_lock()
in the INSERT DELAYED handling.


mysql-test/r/create.result:
  Bug#10224 - ANALYZE TABLE crashing with simultaneous CREATE ... SELECT statement.
  Added test results.
mysql-test/t/create.test:
  Bug#10224 - ANALYZE TABLE crashing with simultaneous CREATE ... SELECT statement.
  Added tests which do not require concurrency.
sql/lock.cc:
  Bug#10224 - ANALYZE TABLE crashing with simultaneous CREATE ... SELECT statement.
  Added a new option to mysql_lock_tables() for ignoring FLUSH TABLES.
  Changed the parameter list.
  Removed two unnecessary functions. Their functionality is included in
  wait_if_global_read_lock() and start_waiting_global_read_lock().
sql/mysql_priv.h:
  Bug#10224 - ANALYZE TABLE crashing with simultaneous CREATE ... SELECT statement.
  Changed the declaration of mysql_lock_tables().
  Added definitions for the new options.
sql/sql_acl.cc:
  Bug#10224 - ANALYZE TABLE crashing with simultaneous CREATE ... SELECT statement.
  Adjusted mysql_lock_tables() calls to the new argument list.
sql/sql_base.cc:
  Bug#10224 - ANALYZE TABLE crashing with simultaneous CREATE ... SELECT statement.
  Adjusted mysql_lock_tables() calls to the new argument list.
sql/sql_handler.cc:
  Bug#10224 - ANALYZE TABLE crashing with simultaneous CREATE ... SELECT statement.
  Adjusted mysql_lock_tables() calls to the new argument list.
sql/sql_insert.cc:
  Bug#10224 - ANALYZE TABLE crashing with simultaneous CREATE ... SELECT statement.
  Replaced set_protect_against_global_read_lock() and
  unset_protect_against_global_read_lock() by
  wait_if_global_read_lock() and start_waiting_global_read_lock()
  in the INSERT DELAYED handling.
  Adjusted mysql_lock_tables() calls to the new argument list.
sql/sql_parse.cc:
  Bug#10224 - ANALYZE TABLE crashing with simultaneous CREATE ... SELECT statement.
  Protected the CREATE TABLE and CREATE TABLE ... SELECT commands
  against a global read lock. This prevents a deadlock in
  CREATE TABLE ... SELECT in conjunction with FLUSH TABLES WITH READ LOCK
  and avoids the creation of new tables during a global read lock.
sql/sql_table.cc:
  Bug#10224 - ANALYZE TABLE crashing with simultaneous CREATE ... SELECT statement.
  Adjusted mysql_lock_tables() calls to the new argument list.
  Used the new option in create_table_from_items().
2005-05-31 11:08:14 +02:00
unknown
e547fbea68 Cleanups to patch for bug #9660 after review by Monty.
sql/sql_table.cc:
  Make return value of build_table_path() useful
  Eliminate some unnecessary casts
2005-05-26 10:01:26 -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
75e8f8372e Fix error reporting for 'OPTIMIZE TABLE' on InnoDB tables. (Bug #8135)
sql/sql_table.cc:
  Pass through errors from InnoDB in OPTIMIZE TABLE.
2005-05-24 11:11:40 -07:00
unknown
2059908b9c After merge fixes
BitKeeper/deleted/.del-outfile2.result~fb702ee2518d8e6d:
  Delete: mysql-test/r/outfile2.result
libmysql/libmysql.c:
  Fix indentation for new function mysql_set_character_set()
mysql-test/r/alter_table.result:
  Fix test to be in same order as in 4.0
mysql-test/r/innodb.result:
  After merge fix
mysql-test/r/insert_update.result:
  Add extra test for insert into ... on duplicate key upate
mysql-test/r/outfile.result:
  After merge fix
mysql-test/t/alter_table.test:
  Fix test to be in same order as in 4.0
mysql-test/t/insert_update.test:
  Add extra test for insert into ... on duplicate key upate
mysql-test/t/outfile.test:
  After merge fix
sql/item_func.cc:
  After merge fix
sql/sql_table.cc:
  After merge fix
2005-05-14 16:24:36 +03:00
unknown
037b0a7b14 Merge with 4.0
BitKeeper/etc/logging_ok:
  auto-union
mysql-test/r/outfile2.result:
  Merge rename: mysql-test/r/outfile.result -> mysql-test/r/outfile2.result
myisam/mi_key.c:
  Auto merged
mysql-test/r/alter_table.result:
  Auto merged
mysql-test/r/auto_increment.result:
  Auto merged
mysql-test/r/innodb.result:
  Auto merged
mysql-test/t/auto_increment.test:
  Auto merged
mysql-test/t/innodb.test:
  Auto merged
sql/handler.h:
  Auto merged
mysql-test/t/alter_table.test:
  Merge
mysql-test/t/outfile.test:
  Merge
sql/item_func.cc:
  Merge
sql/share/czech/errmsg.txt:
  Merge
sql/share/danish/errmsg.txt:
  Merge
sql/share/dutch/errmsg.txt:
  Merge
sql/share/english/errmsg.txt:
  Merge
sql/share/estonian/errmsg.txt:
  Merge
sql/share/french/errmsg.txt:
  Merge
sql/share/german/errmsg.txt:
  Merge
sql/share/greek/errmsg.txt:
  Merge
sql/share/hungarian/errmsg.txt:
  Merge
sql/share/italian/errmsg.txt:
  Merge
sql/share/japanese/errmsg.txt:
  Merge
sql/share/korean/errmsg.txt:
  Merge
sql/share/norwegian-ny/errmsg.txt:
  Merge
sql/share/norwegian/errmsg.txt:
  Merge
sql/share/polish/errmsg.txt:
  Merge
sql/share/portuguese/errmsg.txt:
  Merge
sql/share/romanian/errmsg.txt:
  Merge
sql/share/russian/errmsg.txt:
  Merge
sql/share/slovak/errmsg.txt:
  Merge
sql/share/spanish/errmsg.txt:
  Merge
sql/share/swedish/errmsg.txt:
  Merge
sql/share/ukrainian/errmsg.txt:
  Merge
sql/sql_table.cc:
  Merge
sql/sql_yacc.yy:
  Keep old
sql/unireg.cc:
  Merge
2005-05-14 00:01:40 +03:00
unknown
7c441dd115 Change create_field->offset to store offset from start of fields, independent of null bits.
Count null_bits separately from field offsets and adjust them in case of primary key parts.
(Previously a CREATE TABLE with a lot of null fields that was part of a primary key caused MySQL to wrongly count the number of bytes needed to store null bits)
This is a more complete bug fix for #6236


mysql-test/r/alter_table.result:
  More test for bug #6236 (CREATE TABLE didn't properly count not null columns for primary keys)
mysql-test/t/alter_table.test:
  More test for bug #6236 (CREATE TABLE didn't properly count not null columns for primary keys)
sql/handler.h:
  Add counter for null fields
sql/sql_table.cc:
  Change create_field->offset to store offset from start of fields, independent of null bits.
  Count null_bits separately from field offsets and adjust them in case of primary key parts.
sql/unireg.cc:
  Change create_field->offset to store offset from start of fields, independent of null bits.
  Count null_bits separately from field offsets and adjust them in case of primary key parts.
2005-05-13 11:11:50 +03:00
unknown
3e1dad4115 Bug#6236
Incomplete ALTER TABLE breaks MERGE compatibility
  Fix implicit NOT NULL not set on ALTER of PK columns


mysql-test/r/alter_table.result:
  Test for Bug#6236
mysql-test/t/alter_table.test:
  Test for Bug#6236
sql/sql_table.cc:
  Implicit NOT NULL not set on ALTER of PK columns
BitKeeper/etc/logging_ok:
  Logging to logging@openlogging.org accepted
2005-05-08 21:03:50 +01:00
unknown
ef3e9e1cff Fix 'CREATE TABLE ... LIKE ...' when lower_case_table_names
is set on case-sensitive file systems and the source table
was specified in something other than lowercase. (Bug #9761)


mysql-test/r/lowercase_table.result:
  Add results
mysql-test/t/lowercase_table.test:
  Regression test for Bug #9761
sql/sql_table.cc:
  When lower_case_table_names is set, make sure to look for
  the source table using a lowercase filename.
2005-04-28 15:30:42 -07:00
unknown
30a82dfb7d Fix for BUG#9149 "OPTIMIZE TABLE statement on InnoDB table is logged twice in the binary log"
if we fall back to mysql_alter_table() (for InnoDB), don't do binlogging in mysql_alter_table(), as mysql_admin_table()
is not supposed to do any binlogging (it is done by the caller).


sql/sql_table.cc:
  When optimizing a table, if we fall back to mysql_alter_table()
  (for InnoDB), don't do binlogging in mysql_alter_table(), as mysql_admin_table()
  is not supposed to do any binlogging (it is done by the caller).
2005-04-11 16:46:03 +02:00
unknown
f7356d7391 InnoDB: Prevent ALTER TABLE ... ENGINE=...
if there are foreign key constraints on the table. (Bug #5574)


sql/ha_innodb.cc:
  Add method can_switch_engines()
sql/ha_innodb.h:
  Add method can_switch_engines()
sql/handler.h:
  Add method can_switch_engines()
sql/sql_table.cc:
  Check handler::can_switch_engines() before switching storage engines
2005-04-07 12:16:41 +03:00
unknown
5f8c654a0a merged
mysql-test/r/drop.result:
  Auto merged
mysql-test/t/drop.test:
  Auto merged
sql/share/english/errmsg.txt:
  Auto merged
sql/share/russian/errmsg.txt:
  Auto merged
sql/share/ukrainian/errmsg.txt:
  Auto merged
2005-04-02 20:28:58 +02:00
unknown
7d865e0b12 bug#3891 - DROP TABLE many-unexistent-tables, was printing an error with %s instead of table names
sql/sql_table.cc: print an error with a function that respects width modifiers (%.64s)


mysql-test/r/drop.result:
  bug#3891 - DROP TABLE many-unexistent-tables, was printing an error with %s instead of table names
mysql-test/t/drop.test:
  bug#3891 - DROP TABLE many-unexistent-tables, was printing an error with %s instead of table names
sql/share/english/errmsg.txt:
  allow longer "table names" as DROP TABLE puts a list here
sql/share/russian/errmsg.txt:
  allow longer "table names" as DROP TABLE puts a list here
sql/share/ukrainian/errmsg.txt:
  allow longer "table names" as DROP TABLE puts a list here
sql/sql_table.cc:
  print an error with a function that respects width modifiers (%.64s)
2005-04-02 20:13:19 +02:00
unknown
befe4fa99f Merge test and results
sql/sql_table.cc:
  Auto merged
mysql-test/r/query_cache.result:
  Update results
mysql-test/t/query_cache.test:
  Merge tests
2005-03-11 11:07:32 -08:00
unknown
8e24e6079f Flush entries from the query cache for tables used in
administrative statements that may alter the table, such
as REPAIR TABLE. (Bug #8480)


mysql-test/r/query_cache.result:
  Add new results
mysql-test/t/query_cache.test:
  Add regression test
sql/sql_table.cc:
  Make sure entries are flushed from the query cache for
  any administrative command run on a table that acquires
  a write lock on it (and thus might change it), like 
  REPAIR TABLE.
2005-03-07 18:15:19 -08:00
unknown
3d0f9d96d7 Fixed during review of new pulled code
extra/perror.c:
  Use strmov() instead of strcpy()
  Indentation fixes
sql/sql_table.cc:
  Revert back part of the old code as the new code didn't use mysql_data_home, which would have caused problems in the embedded server
sql/sql_update.cc:
  Ensure that used_index is always set (It has to be set because it's value is tested if order != 0)
2005-02-02 20:28:01 +02:00