List:Commits« Previous MessageNext Message »
From:Michael Widenius Date:August 13 2008 10:11am
Subject:bzr push into mysql-6.0 branch (monty:2685 to 2686)
View as plain text  
 2686 Michael Widenius	2008-08-13
      Fixed compiler warnings on Solaris
modified:
  include/my_global.h
  sql/handler.h

 2685 Michael Widenius	2008-08-13 [merge]
      Automatic merge with MySQL-6.0-maria
removed:
  mysql-test/extra/binlog_tests/implicit.test
  mysql-test/r/merge-big.result
  mysql-test/r/parser.result
  mysql-test/suite/binlog/r/binlog_implicit_commit.result
  mysql-test/suite/binlog/t/binlog_implicit_commit.test
  mysql-test/suite/falcon/r/rpl_falcon_bug_37221.result
  mysql-test/suite/falcon/t/rpl_falcon_bug_37221.test
  mysql-test/t/merge-big.test
  mysql-test/t/parser.test
  sql/backup/debug.h
added:
  mysql-test/extra/binlog_tests/implicit.test
  mysql-test/include/ctype_ascii_order.inc
  mysql-test/include/have_debug_sync.inc
  mysql-test/r/backup_charsets.result
  mysql-test/r/backup_commit_restore.result
  mysql-test/r/backup_compression.result
  mysql-test/r/backup_lock_myisam.result
  mysql-test/r/backup_many_dbs.result
  mysql-test/r/backup_multi_blocks.result
  mysql-test/r/backup_myisam1.result
  mysql-test/r/backup_myisam2.result
  mysql-test/r/backup_no_be.result
  mysql-test/r/backup_nodata_driver.result
  mysql-test/r/backup_procedures.result
  mysql-test/r/backup_triggers_and_events.result
  mysql-test/r/backup_view_on_view.result
  mysql-test/r/backup_views.result
  mysql-test/r/ctype_cp866.result
  mysql-test/r/debug_sync.result
  mysql-test/r/have_debug_sync.require
  mysql-test/r/merge-sync.result
  mysql-test/r/myisamlog.result
  mysql-test/r/parser.result
  mysql-test/suite/backup/
  mysql-test/suite/backup/r/
  mysql-test/suite/backup/r/backup_online_testing.result
  mysql-test/suite/backup/t/
  mysql-test/suite/backup/t/backup_online_testing.test
  mysql-test/suite/binlog/r/binlog_implicit_commit.result
  mysql-test/suite/binlog/t/binlog_implicit_commit.test
  mysql-test/suite/falcon/r/falcon_bug_37343.result
  mysql-test/suite/falcon/r/falcon_bug_37344_A.result
  mysql-test/suite/falcon/r/rpl_falcon_bug_37221.result
  mysql-test/suite/falcon/t/falcon_bug_37343.test
  mysql-test/suite/falcon/t/falcon_bug_37344_A.test
  mysql-test/suite/falcon/t/rpl_falcon_bug_37221.test
  mysql-test/t/backup_charsets.test
  mysql-test/t/backup_commit_restore.test
  mysql-test/t/backup_compression.test
  mysql-test/t/backup_lock_myisam.test
  mysql-test/t/backup_many_dbs.test
  mysql-test/t/backup_multi_blocks.test
  mysql-test/t/backup_myisam1-master.opt
  mysql-test/t/backup_myisam1.test
  mysql-test/t/backup_myisam2.test
  mysql-test/t/backup_no_be.test
  mysql-test/t/backup_nodata_driver.test
  mysql-test/t/backup_procedures.test
  mysql-test/t/backup_triggers_and_events.test
  mysql-test/t/backup_view_on_view.test
  mysql-test/t/backup_views.test
  mysql-test/t/ctype_cp866.test
  mysql-test/t/debug_sync.test
  mysql-test/t/merge-sync.test
  mysql-test/t/myisamlog-master.opt
  mysql-test/t/myisamlog.test
  mysql-test/t/parser.test
  sql/backup/backup_info.cc
  sql/backup/backup_info.h
  sql/backup/be_logical.h
  sql/backup/be_nodata.cc
  sql/backup/be_nodata.h
  sql/backup/restore_info.h
  sql/debug_sync.cc
  storage/falcon/CompareAndSwapSparc.il
  storage/myisam/mi_examine_log.c
  storage/myisam/myisam_backup_engine.cc
renamed:
  mysql-test/suite/falcon/r/falcon_bug_28048.result => mysql-test/suite/falcon_team/r/falcon_bug_28048.result
  mysql-test/suite/falcon/r/falcon_bug_37080.result => mysql-test/suite/falcon_team/r/falcon_bug_37080.result
  mysql-test/suite/falcon/t/falcon_bug_28048.test => mysql-test/suite/falcon_team/t/falcon_bug_28048.test
  mysql-test/suite/falcon/t/falcon_bug_37080.test => mysql-test/suite/falcon_team/t/falcon_bug_37080.test
  mysql-test/suite/falcon_team/r/falcon_read-committed.result => mysql-test/suite/falcon/r/falcon_read-committed.result
  mysql-test/suite/falcon_team/t/falcon_read-committed.test => mysql-test/suite/falcon/t/falcon_read-committed.test
  sql/backup/catalog.cc => sql/backup/image_info.cc
  sql/backup/catalog.h => sql/backup/image_info.h
modified:
  .bzr-mysql/default.conf
  .bzrignore
  CMakeLists.txt*
  client/mysql.cc
  client/mysqltest.c
  configure.in
  dbug/CMakeLists.txt*
  include/atomic/generic-msvc.h
  include/atomic/nolock.h
  include/config-win.h
  include/keycache.h
  include/my_global.h
  include/my_sys.h
  include/myisam.h
  libmysqld/CMakeLists.txt
  libmysqld/Makefile.am
  mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test
  mysql-test/lib/mtr_report.pl
  mysql-test/mysql-test-run.pl
  mysql-test/r/backup.result
  mysql-test/r/backup_commit_blocker.result
  mysql-test/r/backup_ddl_blocker.result
  mysql-test/r/backup_errors.result
  mysql-test/r/backup_objects.result
  mysql-test/r/backup_progress.result
  mysql-test/r/backup_snapshot.result
  mysql-test/r/character_set_server_func.result
  mysql-test/r/ctype_big5.result
  mysql-test/r/ctype_gb2312.result
  mysql-test/r/ctype_gbk.result
  mysql-test/r/ctype_tis620.result
  mysql-test/r/ctype_utf32.result
  mysql-test/r/ctype_utf8.result
  mysql-test/r/fulltext2.result
  mysql-test/r/merge.result
  mysql-test/r/mysql.result
  mysql-test/r/xml.result
  mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result
  mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result
  mysql-test/suite/falcon/r/falcon_bug_22150.result
  mysql-test/suite/falcon/r/falcon_bug_32833.result
  mysql-test/suite/falcon/r/falcon_options.result
  mysql-test/suite/falcon/r/falcon_options2.result
  mysql-test/suite/falcon/t/falcon_bug_22150.test
  mysql-test/suite/falcon/t/falcon_options.test
  mysql-test/suite/falcon/t/falcon_options2.test
  mysql-test/suite/funcs_1/r/is_columns_mysql.result
  mysql-test/suite/funcs_1/triggers/triggers_03.inc
  mysql-test/suite/funcs_1/triggers/triggers_08.inc
  mysql-test/suite/funcs_1/triggers/triggers_1011ext.inc
  mysql-test/suite/rpl/t/disabled.def
  mysql-test/t/backup.test
  mysql-test/t/backup_commit_blocker.test
  mysql-test/t/backup_ddl_blocker.test
  mysql-test/t/backup_errors.test
  mysql-test/t/backup_objects.test
  mysql-test/t/backup_progress.test
  mysql-test/t/backup_security.test
  mysql-test/t/backup_snapshot.test
  mysql-test/t/character_set_server_func.test
  mysql-test/t/ctype_big5.test
  mysql-test/t/ctype_gb2312.test
  mysql-test/t/ctype_gbk.test
  mysql-test/t/ctype_tis620.test
  mysql-test/t/ctype_utf32.test
  mysql-test/t/ctype_utf8.test
  mysql-test/t/disabled.def
  mysql-test/t/fulltext2.test
  mysql-test/t/innodb-autoinc.test
  mysql-test/t/key_cache.test
  mysql-test/t/merge.test
  mysql-test/t/mysql_delimiter.sql
  mysql-test/t/system_mysql_db_fix50030.test
  mysql-test/t/system_mysql_db_fix50117.test
  mysql-test/t/xml.test
  mysql-test/valgrind.supp
  mysys/CMakeLists.txt
  mysys/default.c
  mysys/mf_iocache.c
  mysys/mf_keycache.c
  mysys/mf_pack.c
  mysys/my_thr_init.c
  mysys/thr_lock.c
  scripts/make_binary_distribution.sh
  scripts/mysql_system_tables.sql
  sql/CMakeLists.txt
  sql/Makefile.am
  sql/backup/CMakeLists.txt
  sql/backup/Makefile.am
  sql/backup/api_types.h
  sql/backup/backup_aux.h
  sql/backup/backup_engine.h
  sql/backup/backup_kernel.h
  sql/backup/backup_progress.cc
  sql/backup/backup_progress.h
  sql/backup/backup_stream.h
  sql/backup/backup_test.cc
  sql/backup/be_default.cc
  sql/backup/be_default.h
  sql/backup/be_native.h
  sql/backup/be_snapshot.cc
  sql/backup/be_snapshot.h
  sql/backup/be_thread.cc
  sql/backup/be_thread.h
  sql/backup/buffer_iterator.cc
  sql/backup/buffer_iterator.h
  sql/backup/data_backup.cc
  sql/backup/kernel.cc
  sql/backup/logger.cc
  sql/backup/logger.h
  sql/backup/stream.cc
  sql/backup/stream.h
  sql/backup/stream_services.h
  sql/backup/stream_v1.c
  sql/backup/stream_v1.h
  sql/backup/stream_v1_transport.c
  sql/ddl_blocker.cc
  sql/ddl_blocker.h
  sql/handler.cc
  sql/hostname.cc
  sql/item.cc
  sql/item_func.cc
  sql/item_xmlfunc.cc
  sql/lex.h
  sql/lock.cc
  sql/mysql_priv.h
  sql/mysqld.cc
  sql/set_var.cc
  sql/set_var.h
  sql/share/charsets/cp866.xml
  sql/share/errmsg.txt
  sql/si_objects.cc
  sql/si_objects.h
  sql/sql_array.h
  sql/sql_base.cc
  sql/sql_bitmap.h
  sql/sql_cache.cc
  sql/sql_class.cc
  sql/sql_class.h
  sql/sql_delete.cc
  sql/sql_insert.cc
  sql/sql_lex.h
  sql/sql_load.cc
  sql/sql_parse.cc
  sql/sql_repl.cc
  sql/sql_repl.h
  sql/sql_string.cc
  sql/sql_table.cc
  sql/sql_yacc.yy
  storage/archive/azio.h
  storage/falcon/Cache.cpp
  storage/falcon/Configuration.cpp
  storage/falcon/Connection.cpp
  storage/falcon/Gopher.cpp
  storage/falcon/Gopher.h
  storage/falcon/IO.cpp
  storage/falcon/IOx.h
  storage/falcon/IndexPage.cpp
  storage/falcon/IndexWalker.cpp
  storage/falcon/IndexWalker.h
  storage/falcon/Interlock.h
  storage/falcon/Makefile.am
  storage/falcon/Page.h
  storage/falcon/SectorBuffer.cpp
  storage/falcon/SerialLog.cpp
  storage/falcon/SerialLog.h
  storage/falcon/SerialLogFile.cpp
  storage/falcon/Statement.cpp
  storage/falcon/StorageDatabase.cpp
  storage/falcon/StorageDatabase.h
  storage/falcon/StorageHandler.cpp
  storage/falcon/StorageParameters.h
  storage/falcon/StorageTableShare.cpp
  storage/falcon/StorageTableShare.h
  storage/falcon/TableSpaceManager.cpp
  storage/falcon/Transaction.cpp
  storage/falcon/WalkDeferred.cpp
  storage/falcon/WalkIndex.cpp
  storage/falcon/ha_falcon.cpp
  storage/falcon/ha_falcon.h
  storage/falcon/plug.in
  storage/innobase/include/univ.i
  storage/myisam/CMakeLists.txt
  storage/myisam/Makefile.am
  storage/myisam/ft_parser.c
  storage/myisam/ft_update.c
  storage/myisam/ftdefs.h
  storage/myisam/ha_myisam.cc
  storage/myisam/ha_myisam.h
  storage/myisam/mi_check.c
  storage/myisam/mi_close.c
  storage/myisam/mi_create.c
  storage/myisam/mi_delete.c
  storage/myisam/mi_delete_all.c
  storage/myisam/mi_dynrec.c
  storage/myisam/mi_extra.c
  storage/myisam/mi_locking.c
  storage/myisam/mi_log.c
  storage/myisam/mi_open.c
  storage/myisam/mi_page.c
  storage/myisam/mi_panic.c
  storage/myisam/mi_rrnd.c
  storage/myisam/mi_static.c
  storage/myisam/mi_test2.c
  storage/myisam/mi_test3.c
  storage/myisam/mi_test_all.sh
  storage/myisam/mi_update.c
  storage/myisam/mi_write.c
  storage/myisam/myisam_ftdump.c
  storage/myisam/myisamchk.c
  storage/myisam/myisamdef.h
  storage/myisam/myisamlog.c
  storage/myisam/myisampack.c
  storage/myisammrg/ha_myisammrg.cc
  storage/myisammrg/myrg_info.c
  storage/myisammrg/myrg_open.c
  storage/myisammrg/myrg_queue.c
  storage/myisammrg/myrg_rrnd.c
  strings/ctype-big5.c
  strings/ctype-extra.c
  strings/ctype-gb2312.c
  strings/ctype-gbk.c
  strings/ctype-ucs2.c
  strings/ctype-utf8.c
  support-files/my-huge.cnf.sh
  support-files/my-large.cnf.sh
  support-files/my-medium.cnf.sh
  win/configure.js
  mysql-test/suite/falcon_team/r/falcon_bug_28048.result
  mysql-test/suite/falcon_team/t/falcon_bug_28048.test
  mysql-test/suite/falcon_team/t/falcon_bug_37080.test
  mysql-test/suite/falcon/r/falcon_read-committed.result
  mysql-test/suite/falcon/t/falcon_read-committed.test
  sql/backup/image_info.cc
  sql/backup/image_info.h

=== modified file '.bzrignore'
--- a/.bzrignore	2008-07-09 07:12:43 +0000
+++ b/.bzrignore	2008-08-13 09:00:54 +0000
@@ -1885,4 +1885,6 @@ win/vs8cache.txt
 ylwrap
 zlib/*.ds?
 zlib/*.vcproj
+extra/libevent/event-config.h
 libmysqld/ddl_blocker.cc
+libmysqld/mdl.cc

=== modified file 'include/my_global.h'
--- a/include/my_global.h	2008-07-09 07:12:43 +0000
+++ b/include/my_global.h	2008-08-13 09:18:28 +0000
@@ -1556,7 +1556,7 @@ inline void  operator delete[](void*, vo
 #endif
 
 /* Provide __func__ macro definition for platforms that miss it. */
-#if __STDC_VERSION__ < 199901L
+#if __STDC_VERSION__ < 199901L && !defined(__func__)
 #  if __GNUC__ >= 2
 #    define __func__ __FUNCTION__
 #  else

=== modified file 'mysql-test/mysql-test-run.pl' (properties changed: -x to +x)
=== modified file 'mysql-test/r/maria.result'
--- a/mysql-test/r/maria.result	2008-07-10 15:20:07 +0000
+++ b/mysql-test/r/maria.result	2008-08-12 13:22:05 +0000
@@ -1901,3 +1901,308 @@ check table t2 extended;
 Table	Op	Msg_type	Msg_text
 test.t2	check	status	OK
 drop table t2;
+drop table if exists t1;
+Warnings:
+Note	1051	Unknown table 't1'
+CREATE TABLE t1 (
+col0 float DEFAULT NULL,
+col1 date DEFAULT NULL,   
+col2 double DEFAULT NULL,   
+col3 decimal(10,0) DEFAULT NULL,   
+col4 char(218) DEFAULT NULL,   
+col5 year(4) DEFAULT NULL,   
+col6 datetime DEFAULT NULL,   
+col7 varchar(39) DEFAULT NULL,   
+col8 double DEFAULT NULL,   
+col9 decimal(10,0) DEFAULT NULL,   
+col10 enum('test1','test2','test3') DEFAULT NULL,   
+col11 year(4) DEFAULT NULL,
+col12 tinytext,
+col13 tinyblob,
+col14 date DEFAULT NULL,
+col15 smallint(6) DEFAULT NULL,
+col16 varchar(81) DEFAULT NULL,
+col17 tinytext,
+col18 blob,
+col19 double DEFAULT NULL,
+col20 double DEFAULT NULL,
+col21 varchar(216) DEFAULT NULL,
+col22 enum('test1','test2','test3') DEFAULT NULL,
+col23 decimal(10,0) DEFAULT NULL,
+col24 text,
+col25 varchar(118) DEFAULT NULL,
+col26 tinytext,
+col27 tinyblob,
+col28 double DEFAULT NULL,
+col29 tinyint(4) DEFAULT NULL,
+col30 longtext,
+col31 tinyint(1) DEFAULT NULL,
+col32 char(212) DEFAULT NULL,
+col33 timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+col34 year(4) DEFAULT NULL,
+col35 tinyint(1) DEFAULT NULL,
+col36 enum('test1','test2','test3') DEFAULT NULL,
+col37 decimal(10,0) DEFAULT NULL,
+col38 tinyint(4) DEFAULT NULL,
+col39 double DEFAULT NULL,
+col40 decimal(10,0) DEFAULT NULL,
+col41 enum('test1','test2','test3') DEFAULT NULL,
+col42 longblob,
+col43 text,
+col44 blob,
+col45 year(4) DEFAULT NULL,
+col46 longtext,
+col47 int(11) DEFAULT NULL,
+col48 set('test1','test2','test3') DEFAULT NULL,
+col49 bigint(20) DEFAULT NULL,
+col50 date DEFAULT NULL,
+col51 tinyblob,
+col52 float DEFAULT NULL,
+col53 year(4) DEFAULT NULL,
+col54 decimal(10,0) DEFAULT NULL,
+col55 tinyblob,
+col56 float DEFAULT NULL,
+col57 bigint(20) DEFAULT NULL,
+col58 timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
+col59 enum('test1','test2','test3') DEFAULT NULL,
+col60 bigint(20) DEFAULT NULL,
+col61 year(4) DEFAULT NULL,
+col62 year(4) DEFAULT NULL,
+col63 double DEFAULT NULL,
+col64 tinytext,
+col65 tinyint(4) DEFAULT NULL,
+col66 longtext,
+col67 time DEFAULT NULL,
+col68 bigint(20) DEFAULT NULL,
+col69 char(142) DEFAULT NULL,
+col70 longtext,
+col71 time DEFAULT NULL,
+col72 year(4) DEFAULT NULL,
+col73 longblob,
+col74 enum('test1','test2','test3') DEFAULT NULL,
+col75 decimal(10,0) DEFAULT NULL,
+col76 smallint(6) DEFAULT NULL,
+col77 tinytext,
+col78 date DEFAULT NULL,
+col79 double DEFAULT NULL,
+col80 tinyint(4) DEFAULT NULL,
+col81 float DEFAULT NULL,
+col82 bigint(20) DEFAULT NULL,
+col83 double DEFAULT NULL,
+col84 varchar(124) DEFAULT NULL,
+col85 double DEFAULT NULL,
+col86 tinyblob,
+col87 tinyblob,
+col88 double DEFAULT NULL,
+col89 date DEFAULT NULL,
+col90 decimal(10,0) DEFAULT NULL,
+col91 set('test1','test2','test3') DEFAULT NULL,
+col92 blob,
+col93 char(174) DEFAULT NULL,
+col94 double DEFAULT NULL,
+col95 tinytext,
+col96 decimal(10,0) DEFAULT NULL,
+col97 year(4) DEFAULT NULL,
+col98 tinyblob,
+col99 datetime DEFAULT NULL,
+col100 longblob,
+col101 date DEFAULT NULL,
+col102 float DEFAULT NULL,
+col103 float DEFAULT NULL,
+col104 int(11) DEFAULT NULL,
+col105 longblob,
+col106 timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
+col107 float DEFAULT NULL,
+col108 text,
+col109 float DEFAULT NULL,
+col110 decimal(10,0) DEFAULT NULL,
+col111 double DEFAULT NULL,
+col112 double DEFAULT NULL,
+col113 blob,
+col114 varchar(152) DEFAULT NULL,
+col115 bigint(20) DEFAULT NULL,
+col116 decimal(10,0) DEFAULT NULL,
+col117 mediumint(9) DEFAULT NULL,
+col118 tinytext,
+col119 tinyblob,
+col120 int(11) DEFAULT NULL,
+col121 bigint(20) DEFAULT NULL,
+col122 double DEFAULT NULL,
+col123 date DEFAULT NULL,
+col124 longtext,
+col125 longtext,
+col126 double DEFAULT NULL,
+col127 varchar(84) DEFAULT NULL,
+col128 text,
+col129 double DEFAULT NULL,
+col130 enum('test1','test2','test3') DEFAULT NULL,
+col131 time DEFAULT NULL,
+col132 year(4) DEFAULT NULL,
+col133 blob,
+col134 tinytext,
+col135 double DEFAULT NULL,
+col136 tinytext,
+col137 bigint(20) DEFAULT NULL,
+col138 datetime DEFAULT NULL,
+col139 double DEFAULT NULL,
+col140 decimal(10,0) DEFAULT NULL,
+col141 longtext,
+col142 tinyint(1) DEFAULT NULL,
+col143 time DEFAULT NULL,
+col144 time DEFAULT NULL,
+col145 float DEFAULT NULL,
+col146 longblob,
+col147 float DEFAULT NULL,
+col148 text,
+col149 mediumint(9) DEFAULT NULL,
+col150 tinyblob,
+col151 tinyblob,
+col152 tinytext,
+col153 tinyblob,
+col154 tinyblob,
+col155 tinytext,
+col156 tinyint(1) DEFAULT NULL,
+col157 tinytext,
+col158 time DEFAULT NULL,
+col159 date DEFAULT NULL,
+col160 longtext,
+col161 enum('test1','test2','test3') DEFAULT NULL,
+col162 text,
+col163 decimal(10,0) DEFAULT NULL,
+col164 time DEFAULT NULL,
+col165 longblob,
+col166 tinyint(4) DEFAULT NULL,
+col167 bigint(20) DEFAULT NULL,
+col168 decimal(10,0) DEFAULT NULL,
+col169 smallint(6) DEFAULT NULL,
+col170 tinytext,
+col171 tinyint(4) DEFAULT NULL,
+col172 tinyint(1) DEFAULT NULL,
+col173 tinytext,
+col174 decimal(10,0) DEFAULT NULL,
+col175 double DEFAULT NULL
+) engine=maria DEFAULT CHARSET=latin1 COMMENT='generated';
+insert ignore into t1 set 
+col10=abs(28449) % 2,
+col11='1973',
+col12=if(abs(-30039)%100<20,null,'forgery\'s'),
+col13=if(abs(24672)%100<20,null,'adductor\'s'),
+col16=if(abs(26872)%100<20,null,'0xf810e016ee0b78e1ce8b1c6cf8d2e82bf8507453768a3908dc20cecfc9a0ac0ac00079d0645a4c'),
+col18=if(abs(-15854)%100<20,null,'unattractiveness'),
+col19=if(abs(4287439673.9896235000)%100<20,null,25288),
+col20=if(abs(4290800136.7527390000)%100<20,null,8887),
+col21=if(abs(-26086)%100<20,null,'0x2334181c6068aab18b348ecc1e2600b81e1c5f821eee3e204824'),
+col22=abs(-21921) % 2,
+col23=if(abs(1503277.6900540178)%100<20,null,-23298),
+col25=if(abs(29674)%100<20,null,'0xc8d094f888ee20c83baef8d9380a168d40f4906e742a4dc0daeacb809e64095c71d510c7c0f83a6a0a04b8d6a0d9bea2dc3d4bd44d9c5002e440707c40ead8b3eb20a100a8524b1616a338a440ea02a25a08041810a08cac087cd47b4a79f08730946c5800600ae45e1c08f637'),
+col26=if(abs(28642)%100<20,null,'insubstantiality\'s'),
+col27=if(abs(-3188)%100<20,null,'exine\'s'),
+col29=if(abs(-47)%100<20,null,-24131),
+col32=if(abs(-3658)%100<20,null,'shortener\'s'),
+col34='1917',
+col36=abs(27782) % 2,
+col37=if(abs(4864972.0244758446)%100<20,null,32302),
+col38=if(abs(97)%100<20,null,-14079),
+col39=if(abs(3362872.0521256141)%100<20,null,27191),
+col40=if(abs(3348292.2110660113)%100<20,null,-1163),
+col41=abs(-18533) % 2,
+col42=if(abs(2094)%100<20,null,'Montparnasse'),
+col43=if(abs(-15983)%100<20,null,'Massasoit\'s'),
+col44=if(abs(2497)%100<20,null,'lags'),
+col45='2057',
+col46=if(abs(-31691)%100<20,null,'miscegenation\'s'),
+col47=if(abs(-1269564297)%100<20,null,1089),
+col49=if(abs(-1815717335)%100<20,null,-17504),
+col51=if(abs(-15263)%100<20,null,'virelay'),
+col52=if(abs(2227333.3279519030)%100<20,null,-5210),
+col53='2032',
+col54=if(abs(791647.5947447127)%100<20,null,32576),
+col55=if(abs(20293)%100<20,null,'tumblebug'),
+col56=if(abs(4288698564.2967925000)%100<20,null,17141),
+col57=if(abs(-2138460927)%100<20,null,14495),
+col59=abs(7624) % 2,
+col60=if(abs(-1500892492)%100<20,null,-68),
+col63=if(abs(4290890487.3789482000)%100<20,null,-32129),
+col65=if(abs(22)%100<20,null,15722),
+col79=if(abs(4292420489.2606282000)%100<20,null,-23891),
+col84=if(abs(-21248)%100<20,null,'0x4f9888d044435050eab83cb3dcad88b01886e434e216'),
+col85=if(abs(4294260188.6230965000)%100<20,null,16867),
+col86=if(abs(-11659)%100<20,null,'prewar'),
+col87=if(abs(-2253)%100<20,null,'Radnorshire'),
+col90=if(abs(4287254529.4026613000)%100<20,null,23506),
+col92=if(abs(6472)%100<20,null,'electroplated'),
+col93=if(abs(-13523)%100<20,null,'sparkiest'),
+col95=if(abs(23998)%100<20,null,'Crimea'),
+col96=if(abs(4287719060.2789087000)%100<20,null,20527),
+col98=if(abs(-14090)%100<20,null,'firebrat'),
+col99='19161023095430',
+col100=if(abs(-31178)%100<20,null,'clinical'),
+col102=if(abs(4407547.5205542166)%100<20,null,18226),
+col103=if(abs(4286834687.5994444000)%100<20,null,27520),
+col104=if(abs(-2105663477)%100<20,null,28591),
+col105=if(abs(1929)%100<20,null,'renascent'),
+col107=if(abs(5972348.8099917602)%100<20,null,-11408),
+col108=if(abs(-11262)%100<20,null,'aircraftmen'),
+col110=if(abs(6530491.4546037167)%100<20,null,-17672),
+col111=if(abs(4289897795.5000763000)%100<20,null,3742),
+col112=if(abs(1680557.8560441907)%100<20,null,13944),
+col113=if(abs(-27195)%100<20,null,'dekameter'),
+col115=if(abs(-2083419827)%100<20,null,-17272),
+col117=if(abs(1704826)%100<20,null,17880),
+col118=if(abs(-2848)%100<20,null,'judicatory'),
+col119=if(abs(-28087)%100<20,null,'mistitles'),
+col120=if(abs(-2100119097)%100<20,null,22465),
+col121=if(abs(-1868777891)%100<20,null,15172),
+col122=if(abs(7039857.3608508557)%100<20,null,-22154),
+col125=if(abs(70)%100<20,null,'Hong\'s'),
+col126=if(abs(3820673.5968199712)%100<20,null,-24185),
+col127=if(abs(12331)%100<20,null,'0x674e14584e88fca3fed0a0b1488a440008228aa01454a65cf09e3f0fa0511c3ce2f8688450'),
+col128=if(abs(20335)%100<20,null,'Zoroaster\'s'),
+col129=if(abs(3916577.6225165562)%100<20,null,-4088),
+col130=abs(-15003) % 2,
+col132='2016',
+col134=if(abs(-26555)%100<20,null,'Caesarea'),
+col135=if(abs(4288484655.2416148000)%100<20,null,-30073),
+col136=if(abs(-17577)%100<20,null,'upbraid'),
+col137=if(abs(-1742797945)%100<20,null,-21651),
+col138='20751113181230',
+col139=if(abs(4288997063.9889216000)%100<20,null,1816),
+col141=if(abs(-31448)%100<20,null,'threnodist'),
+col142=if(abs(88)%100<20,null,-19748),
+col143='6930607',
+col144='5760250',
+col145=if(abs(3591496.9625843074)%100<20,null,76),
+col146=if(abs(20875)%100<20,null,'rename'),
+col147=if(abs(4294789439.6773582000)%100<20,null,32314),
+col148=if(abs(7072)%100<20,null,'recesses'),
+col150=if(abs(-26540)%100<20,null,'cuckoo'),
+col152=if(abs(23553)%100<20,null,'shortened'),
+col153=if(abs(-30422)%100<20,null,'inhabitant'),
+col154=if(abs(30457)%100<20,null,'Orwellian'),
+col155=if(abs(-30263)%100<20,null,'Ptolemies'),
+col156=if(abs(-41)%100<20,null,6382),
+col157=if(abs(2557)%100<20,null,'horsewhips'),
+col158='2764427',
+col160=if(abs(-15872)%100<20,null,'girlhood'),
+col161=abs(15378) % 2,
+col163=if(abs(4286662730.9309368000)%100<20,null,-19516),
+col167=if(abs(-1881918655)%100<20,null,6927),
+col169=if(abs(-14442)%100<20,null,-6392),
+col170=if(abs(29965)%100<20,null,'resynthesis'),
+col173=if(abs(-451)%100<20,null,'Clute'),
+col174=if(abs(3262594.6284981840)%100<20,null,17846);
+Warnings:
+Warning	1265	Data truncated for column 'col25' at row 1
+Warning	1264	Out of range value for column 'col29' at row 1
+Warning	1265	Data truncated for column 'col36' at row 1
+Warning	1264	Out of range value for column 'col38' at row 1
+Warning	1265	Data truncated for column 'col59' at row 1
+Warning	1264	Out of range value for column 'col65' at row 1
+Warning	1264	Out of range value for column 'col142' at row 1
+Warning	1264	Out of range value for column 'col156' at row 1
+Warning	1265	Data truncated for column 'col161' at row 1
+update ignore t1 set col165=repeat('a',7000);
+check table t1;
+Table	Op	Msg_type	Msg_text
+test.t1	check	status	OK
+drop table t1;

=== modified file 'mysql-test/r/maria2.result'
--- a/mysql-test/r/maria2.result	2008-06-10 14:44:44 +0000
+++ b/mysql-test/r/maria2.result	2008-08-12 10:59:30 +0000
@@ -1,3 +1,4 @@
+drop table if exists t1,t2;
 CREATE TABLE t1 (
 line BLOB,
 kind ENUM('po', 'pp', 'rr', 'dr', 'rd', 'ts', 'cl') NOT NULL DEFAULT 'po',
@@ -16,3 +17,44 @@ check table t1 extended;
 Table	Op	Msg_type	Msg_text
 test.t1	check	status	OK
 drop table t1;
+create table t1 (i int) engine=maria;
+create table t2 (j int) engine=maria;
+lock table t1 write, t2 read;
+alter table t1 modify i int default 1;
+insert into t1 values (2);
+alter table t1 modify i bigint default 1;
+select count(*) from t1;
+count(*)
+1
+select * from t1;
+i
+2
+unlock tables;
+drop table t1,t2;
+create table t1(id int, s char(1), unique(s)) engine=maria;
+insert into t1 values(1,"a") on duplicate key update t1.id=t1.id+1;
+insert into t1 values(1,"a") on duplicate key update t1.id=t1.id+1;
+insert into t1 select 1,"a" on duplicate key update t1.id=t1.id+1;
+select * from t1;
+id	s
+3	a
+replace into t1 select 1,"a";
+select * from t1;
+id	s
+1	a
+drop table t1;
+create table t1 (pk int primary key, apk int unique, data int) engine=maria;
+insert into t1 values (1, 1, 1), (4, 4, 4), (6, 6, 6);
+load data concurrent infile '../std_data_ln/loaddata5.dat' replace into table t1 fields terminated by '' enclosed by '' ignore 1 lines (pk, apk);
+select * from t1 order by pk;
+pk	apk	data
+1	1	1
+3	4	NULL
+5	6	NULL
+load data infile '../std_data_ln/loaddata5.dat' replace into table t1 fields terminated by '' enclosed by '' ignore 1 lines (pk, apk);
+select * from t1 order by pk;
+pk	apk	data
+1	1	1
+3	4	NULL
+5	6	NULL
+drop table t1;

=== modified file 'mysql-test/t/maria.test'
--- a/mysql-test/t/maria.test	2008-07-10 15:20:07 +0000
+++ b/mysql-test/t/maria.test	2008-08-12 13:22:05 +0000
@@ -1188,6 +1188,301 @@ insert into t2 values (repeat('x',28)), 
 check table t2 extended;
 drop table t2;
 
+drop table if exists t1;
+CREATE TABLE t1 (
+col0 float DEFAULT NULL,
+col1 date DEFAULT NULL,   
+col2 double DEFAULT NULL,   
+col3 decimal(10,0) DEFAULT NULL,   
+col4 char(218) DEFAULT NULL,   
+col5 year(4) DEFAULT NULL,   
+col6 datetime DEFAULT NULL,   
+col7 varchar(39) DEFAULT NULL,   
+col8 double DEFAULT NULL,   
+col9 decimal(10,0) DEFAULT NULL,   
+col10 enum('test1','test2','test3') DEFAULT NULL,   
+col11 year(4) DEFAULT NULL,
+col12 tinytext,
+col13 tinyblob,
+col14 date DEFAULT NULL,
+col15 smallint(6) DEFAULT NULL,
+col16 varchar(81) DEFAULT NULL,
+col17 tinytext,
+col18 blob,
+col19 double DEFAULT NULL,
+col20 double DEFAULT NULL,
+col21 varchar(216) DEFAULT NULL,
+col22 enum('test1','test2','test3') DEFAULT NULL,
+col23 decimal(10,0) DEFAULT NULL,
+col24 text,
+col25 varchar(118) DEFAULT NULL,
+col26 tinytext,
+col27 tinyblob,
+col28 double DEFAULT NULL,
+col29 tinyint(4) DEFAULT NULL,
+col30 longtext,
+col31 tinyint(1) DEFAULT NULL,
+col32 char(212) DEFAULT NULL,
+col33 timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+col34 year(4) DEFAULT NULL,
+col35 tinyint(1) DEFAULT NULL,
+col36 enum('test1','test2','test3') DEFAULT NULL,
+col37 decimal(10,0) DEFAULT NULL,
+col38 tinyint(4) DEFAULT NULL,
+col39 double DEFAULT NULL,
+col40 decimal(10,0) DEFAULT NULL,
+col41 enum('test1','test2','test3') DEFAULT NULL,
+col42 longblob,
+col43 text,
+col44 blob,
+col45 year(4) DEFAULT NULL,
+col46 longtext,
+col47 int(11) DEFAULT NULL,
+col48 set('test1','test2','test3') DEFAULT NULL,
+col49 bigint(20) DEFAULT NULL,
+col50 date DEFAULT NULL,
+col51 tinyblob,
+col52 float DEFAULT NULL,
+col53 year(4) DEFAULT NULL,
+col54 decimal(10,0) DEFAULT NULL,
+col55 tinyblob,
+col56 float DEFAULT NULL,
+col57 bigint(20) DEFAULT NULL,
+col58 timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
+col59 enum('test1','test2','test3') DEFAULT NULL,
+col60 bigint(20) DEFAULT NULL,
+col61 year(4) DEFAULT NULL,
+col62 year(4) DEFAULT NULL,
+col63 double DEFAULT NULL,
+col64 tinytext,
+col65 tinyint(4) DEFAULT NULL,
+col66 longtext,
+col67 time DEFAULT NULL,
+col68 bigint(20) DEFAULT NULL,
+col69 char(142) DEFAULT NULL,
+col70 longtext,
+col71 time DEFAULT NULL,
+col72 year(4) DEFAULT NULL,
+col73 longblob,
+col74 enum('test1','test2','test3') DEFAULT NULL,
+col75 decimal(10,0) DEFAULT NULL,
+col76 smallint(6) DEFAULT NULL,
+col77 tinytext,
+col78 date DEFAULT NULL,
+col79 double DEFAULT NULL,
+col80 tinyint(4) DEFAULT NULL,
+col81 float DEFAULT NULL,
+col82 bigint(20) DEFAULT NULL,
+col83 double DEFAULT NULL,
+col84 varchar(124) DEFAULT NULL,
+col85 double DEFAULT NULL,
+col86 tinyblob,
+col87 tinyblob,
+col88 double DEFAULT NULL,
+col89 date DEFAULT NULL,
+col90 decimal(10,0) DEFAULT NULL,
+col91 set('test1','test2','test3') DEFAULT NULL,
+col92 blob,
+col93 char(174) DEFAULT NULL,
+col94 double DEFAULT NULL,
+col95 tinytext,
+col96 decimal(10,0) DEFAULT NULL,
+col97 year(4) DEFAULT NULL,
+col98 tinyblob,
+col99 datetime DEFAULT NULL,
+col100 longblob,
+col101 date DEFAULT NULL,
+col102 float DEFAULT NULL,
+col103 float DEFAULT NULL,
+col104 int(11) DEFAULT NULL,
+col105 longblob,
+col106 timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
+col107 float DEFAULT NULL,
+col108 text,
+col109 float DEFAULT NULL,
+col110 decimal(10,0) DEFAULT NULL,
+col111 double DEFAULT NULL,
+col112 double DEFAULT NULL,
+col113 blob,
+col114 varchar(152) DEFAULT NULL,
+col115 bigint(20) DEFAULT NULL,
+col116 decimal(10,0) DEFAULT NULL,
+col117 mediumint(9) DEFAULT NULL,
+col118 tinytext,
+col119 tinyblob,
+col120 int(11) DEFAULT NULL,
+col121 bigint(20) DEFAULT NULL,
+col122 double DEFAULT NULL,
+col123 date DEFAULT NULL,
+col124 longtext,
+col125 longtext,
+col126 double DEFAULT NULL,
+col127 varchar(84) DEFAULT NULL,
+col128 text,
+col129 double DEFAULT NULL,
+col130 enum('test1','test2','test3') DEFAULT NULL,
+col131 time DEFAULT NULL,
+col132 year(4) DEFAULT NULL,
+col133 blob,
+col134 tinytext,
+col135 double DEFAULT NULL,
+col136 tinytext,
+col137 bigint(20) DEFAULT NULL,
+col138 datetime DEFAULT NULL,
+col139 double DEFAULT NULL,
+col140 decimal(10,0) DEFAULT NULL,
+col141 longtext,
+col142 tinyint(1) DEFAULT NULL,
+col143 time DEFAULT NULL,
+col144 time DEFAULT NULL,
+col145 float DEFAULT NULL,
+col146 longblob,
+col147 float DEFAULT NULL,
+col148 text,
+col149 mediumint(9) DEFAULT NULL,
+col150 tinyblob,
+col151 tinyblob,
+col152 tinytext,
+col153 tinyblob,
+col154 tinyblob,
+col155 tinytext,
+col156 tinyint(1) DEFAULT NULL,
+col157 tinytext,
+col158 time DEFAULT NULL,
+col159 date DEFAULT NULL,
+col160 longtext,
+col161 enum('test1','test2','test3') DEFAULT NULL,
+col162 text,
+col163 decimal(10,0) DEFAULT NULL,
+col164 time DEFAULT NULL,
+col165 longblob,
+col166 tinyint(4) DEFAULT NULL,
+col167 bigint(20) DEFAULT NULL,
+col168 decimal(10,0) DEFAULT NULL,
+col169 smallint(6) DEFAULT NULL,
+col170 tinytext,
+col171 tinyint(4) DEFAULT NULL,
+col172 tinyint(1) DEFAULT NULL,
+col173 tinytext,
+col174 decimal(10,0) DEFAULT NULL,
+col175 double DEFAULT NULL
+) engine=maria DEFAULT CHARSET=latin1 COMMENT='generated';
+
+
+insert ignore into t1 set 
+col10=abs(28449) % 2,
+col11='1973',
+col12=if(abs(-30039)%100<20,null,'forgery\'s'),
+col13=if(abs(24672)%100<20,null,'adductor\'s'),
+col16=if(abs(26872)%100<20,null,'0xf810e016ee0b78e1ce8b1c6cf8d2e82bf8507453768a3908dc20cecfc9a0ac0ac00079d0645a4c'),
+col18=if(abs(-15854)%100<20,null,'unattractiveness'),
+col19=if(abs(4287439673.9896235000)%100<20,null,25288),
+col20=if(abs(4290800136.7527390000)%100<20,null,8887),
+col21=if(abs(-26086)%100<20,null,'0x2334181c6068aab18b348ecc1e2600b81e1c5f821eee3e204824'),
+col22=abs(-21921) % 2,
+col23=if(abs(1503277.6900540178)%100<20,null,-23298),
+col25=if(abs(29674)%100<20,null,'0xc8d094f888ee20c83baef8d9380a168d40f4906e742a4dc0daeacb809e64095c71d510c7c0f83a6a0a04b8d6a0d9bea2dc3d4bd44d9c5002e440707c40ead8b3eb20a100a8524b1616a338a440ea02a25a08041810a08cac087cd47b4a79f08730946c5800600ae45e1c08f637'),
+col26=if(abs(28642)%100<20,null,'insubstantiality\'s'),
+col27=if(abs(-3188)%100<20,null,'exine\'s'),
+col29=if(abs(-47)%100<20,null,-24131),
+col32=if(abs(-3658)%100<20,null,'shortener\'s'),
+col34='1917',
+col36=abs(27782) % 2,
+col37=if(abs(4864972.0244758446)%100<20,null,32302),
+col38=if(abs(97)%100<20,null,-14079),
+col39=if(abs(3362872.0521256141)%100<20,null,27191),
+col40=if(abs(3348292.2110660113)%100<20,null,-1163),
+col41=abs(-18533) % 2,
+col42=if(abs(2094)%100<20,null,'Montparnasse'),
+col43=if(abs(-15983)%100<20,null,'Massasoit\'s'),
+col44=if(abs(2497)%100<20,null,'lags'),
+col45='2057',
+col46=if(abs(-31691)%100<20,null,'miscegenation\'s'),
+col47=if(abs(-1269564297)%100<20,null,1089),
+col49=if(abs(-1815717335)%100<20,null,-17504),
+col51=if(abs(-15263)%100<20,null,'virelay'),
+col52=if(abs(2227333.3279519030)%100<20,null,-5210),
+col53='2032',
+col54=if(abs(791647.5947447127)%100<20,null,32576),
+col55=if(abs(20293)%100<20,null,'tumblebug'),
+col56=if(abs(4288698564.2967925000)%100<20,null,17141),
+col57=if(abs(-2138460927)%100<20,null,14495),
+col59=abs(7624) % 2,
+col60=if(abs(-1500892492)%100<20,null,-68),
+col63=if(abs(4290890487.3789482000)%100<20,null,-32129),
+col65=if(abs(22)%100<20,null,15722),
+col79=if(abs(4292420489.2606282000)%100<20,null,-23891),
+col84=if(abs(-21248)%100<20,null,'0x4f9888d044435050eab83cb3dcad88b01886e434e216'),
+col85=if(abs(4294260188.6230965000)%100<20,null,16867),
+col86=if(abs(-11659)%100<20,null,'prewar'),
+col87=if(abs(-2253)%100<20,null,'Radnorshire'),
+col90=if(abs(4287254529.4026613000)%100<20,null,23506),
+col92=if(abs(6472)%100<20,null,'electroplated'),
+col93=if(abs(-13523)%100<20,null,'sparkiest'),
+col95=if(abs(23998)%100<20,null,'Crimea'),
+col96=if(abs(4287719060.2789087000)%100<20,null,20527),
+col98=if(abs(-14090)%100<20,null,'firebrat'),
+col99='19161023095430',
+col100=if(abs(-31178)%100<20,null,'clinical'),
+col102=if(abs(4407547.5205542166)%100<20,null,18226),
+col103=if(abs(4286834687.5994444000)%100<20,null,27520),
+col104=if(abs(-2105663477)%100<20,null,28591),
+col105=if(abs(1929)%100<20,null,'renascent'),
+col107=if(abs(5972348.8099917602)%100<20,null,-11408),
+col108=if(abs(-11262)%100<20,null,'aircraftmen'),
+col110=if(abs(6530491.4546037167)%100<20,null,-17672),
+col111=if(abs(4289897795.5000763000)%100<20,null,3742),
+col112=if(abs(1680557.8560441907)%100<20,null,13944),
+col113=if(abs(-27195)%100<20,null,'dekameter'),
+col115=if(abs(-2083419827)%100<20,null,-17272),
+col117=if(abs(1704826)%100<20,null,17880),
+col118=if(abs(-2848)%100<20,null,'judicatory'),
+col119=if(abs(-28087)%100<20,null,'mistitles'),
+col120=if(abs(-2100119097)%100<20,null,22465),
+col121=if(abs(-1868777891)%100<20,null,15172),
+col122=if(abs(7039857.3608508557)%100<20,null,-22154),
+col125=if(abs(70)%100<20,null,'Hong\'s'),
+col126=if(abs(3820673.5968199712)%100<20,null,-24185),
+col127=if(abs(12331)%100<20,null,'0x674e14584e88fca3fed0a0b1488a440008228aa01454a65cf09e3f0fa0511c3ce2f8688450'),
+col128=if(abs(20335)%100<20,null,'Zoroaster\'s'),
+col129=if(abs(3916577.6225165562)%100<20,null,-4088),
+col130=abs(-15003) % 2,
+col132='2016',
+col134=if(abs(-26555)%100<20,null,'Caesarea'),
+col135=if(abs(4288484655.2416148000)%100<20,null,-30073),
+col136=if(abs(-17577)%100<20,null,'upbraid'),
+col137=if(abs(-1742797945)%100<20,null,-21651),
+col138='20751113181230',
+col139=if(abs(4288997063.9889216000)%100<20,null,1816),
+col141=if(abs(-31448)%100<20,null,'threnodist'),
+col142=if(abs(88)%100<20,null,-19748),
+col143='6930607',
+col144='5760250',
+col145=if(abs(3591496.9625843074)%100<20,null,76),
+col146=if(abs(20875)%100<20,null,'rename'),
+col147=if(abs(4294789439.6773582000)%100<20,null,32314),
+col148=if(abs(7072)%100<20,null,'recesses'),
+col150=if(abs(-26540)%100<20,null,'cuckoo'),
+col152=if(abs(23553)%100<20,null,'shortened'),
+col153=if(abs(-30422)%100<20,null,'inhabitant'),
+col154=if(abs(30457)%100<20,null,'Orwellian'),
+col155=if(abs(-30263)%100<20,null,'Ptolemies'),
+col156=if(abs(-41)%100<20,null,6382),
+col157=if(abs(2557)%100<20,null,'horsewhips'),
+col158='2764427',
+col160=if(abs(-15872)%100<20,null,'girlhood'),
+col161=abs(15378) % 2,
+col163=if(abs(4286662730.9309368000)%100<20,null,-19516),
+col167=if(abs(-1881918655)%100<20,null,6927),
+col169=if(abs(-14442)%100<20,null,-6392),
+col170=if(abs(29965)%100<20,null,'resynthesis'),
+col173=if(abs(-451)%100<20,null,'Clute'),
+col174=if(abs(3262594.6284981840)%100<20,null,17846);
+
+update ignore t1 set col165=repeat('a',7000);
+check table t1;
+drop table t1;
+
 --disable_result_log
 --disable_query_log
 eval set global storage_engine=$default_engine, maria_page_checksum=$default_checksum;

=== modified file 'mysql-test/t/maria2.test'
--- a/mysql-test/t/maria2.test	2008-06-10 14:44:44 +0000
+++ b/mysql-test/t/maria2.test	2008-08-12 10:59:30 +0000
@@ -1,5 +1,10 @@
 --source include/have_maria.inc
 
+# Initialise
+--disable_warnings
+drop table if exists t1,t2;
+--enable_warnings
+
 # Test for BUG#36319
 # "Maria: table is not empty but DELETE and SELECT find no rows"
 
@@ -64,3 +69,43 @@ select count(*) from t1;
 select name from t1;
 check table t1 extended;
 drop table t1;
+
+#
+# Testing of ALTER TABLE under lock tables
+#
+
+create table t1 (i int) engine=maria;
+create table t2 (j int) engine=maria;
+lock table t1 write, t2 read;
+alter table t1 modify i int default 1;
+insert into t1 values (2);
+# This caused a core dump
+alter table t1 modify i bigint default 1;
+select count(*) from t1;
+select * from t1;
+unlock tables;
+drop table t1,t2;
+
+#
+# test INSERT ON DUPLICATE KEY UPDATE
+#
+
+create table t1(id int, s char(1), unique(s)) engine=maria;
+insert into t1 values(1,"a") on duplicate key update t1.id=t1.id+1;
+insert into t1 values(1,"a") on duplicate key update t1.id=t1.id+1;
+insert into t1 select 1,"a" on duplicate key update t1.id=t1.id+1;
+select * from t1;
+
+# test REPLACE SELECT
+replace into t1 select 1,"a";
+select * from t1;
+drop table t1;
+
+# test LOAD DATA INFILE REPLACE
+create table t1 (pk int primary key, apk int unique, data int) engine=maria;
+insert into t1 values (1, 1, 1), (4, 4, 4), (6, 6, 6);
+load data concurrent infile '../std_data_ln/loaddata5.dat' replace into table t1 fields terminated by '' enclosed by '' ignore 1 lines (pk, apk);
+select * from t1 order by pk;
+load data infile '../std_data_ln/loaddata5.dat' replace into table t1 fields terminated by '' enclosed by '' ignore 1 lines (pk, apk);
+select * from t1 order by pk;
+drop table t1;

=== modified file 'mysql-test/valgrind.supp'
--- a/mysql-test/valgrind.supp	2008-07-09 07:12:43 +0000
+++ b/mysql-test/valgrind.supp	2008-08-13 09:00:54 +0000
@@ -27,7 +27,7 @@
    pthread allocate_tls memory loss
    Memcheck:Leak
    fun:calloc
-   obj:/lib64/ld*.so
+   obj:/lib*/ld*.so
    fun:_dl_allocate_tls
    fun:pthread_create*
 }
@@ -396,40 +396,58 @@
 }
 
 {
-   dlopen / ptread_cancel_init memory loss on Suse Linux 10.3 64 bit
+   dlopen / ptread_cancel_init memory loss on Suse Linux 10.3 32/64 bit
    Memcheck:Leak
    fun:*alloc
-   obj:/lib64/ld-*.so
-   obj:/lib64/ld-*.so
-   obj:/lib64/ld-*.so
-   obj:/lib64/ld-*.so
-   obj:/lib64/ld-*.so
-   obj:/lib64/ld-*.so
-   obj:/lib64/libc-*.so
-   obj:/lib64/ld-*.so
-   obj:/lib64/libc-*.so
+   obj:/lib*/ld-*.so
+   obj:/lib*/ld-*.so
+   obj:/lib*/ld-*.so
+   obj:/lib*/ld-*.so
+   obj:/lib*/ld-*.so
+   obj:/lib*/ld-*.so
+   obj:/lib*/libc-*.so
+   obj:/lib*/ld-*.so
+   obj:/lib*/libc-*.so
    fun:__libc_dlopen_mode
    fun:pthread_cancel_init
    fun:_Unwind_ForcedUnwind
-
 }
 
 {
-   dlopen / ptread_cancel_init memory loss on Suse Linux 10.3 64 bit
+   dlopen / ptread_cancel_init memory loss on Suse Linux 10.3 32/64 bit
    Memcheck:Leak
    fun:*alloc
-   obj:/lib64/ld-*.so
-   obj:/lib64/ld-*.so
-   obj:/lib64/ld-*.so
-   obj:/lib64/ld-*.so
-   obj:/lib64/libc-*.so
-   obj:/lib64/ld-*.so
-   obj:/lib64/libc-*.so
+   obj:/lib*/ld-*.so
+   obj:/lib*/ld-*.so
+   obj:/lib*/ld-*.so
+   obj:/lib*/ld-*.so
+   obj:/lib*/libc-*.so
+   obj:/lib*/ld-*.so
+   obj:/lib*/libc-*.so
    fun:__libc_dlopen_mode
    fun:pthread_cancel_init
    fun:_Unwind_ForcedUnwind
 }
 
+#
+# Reading wrong addresses on SuSe Linux 10.3 32 bit
+#
+
+{
+   Reading wrong data in libc_dlopen
+   Memcheck:Addr4
+   obj:/lib*/ld-*.so
+   obj:/lib*/ld-*.so
+   obj:/lib*/ld-*.so
+   obj:/lib*/ld-*.so
+   obj:/lib*/ld-*.so
+   obj:/lib*/ld-*.so
+   obj:/lib*/libc-*.so
+   obj:/lib*/ld-*.so
+   obj:/lib*/libc-*.so
+   fun:__libc_dlopen_mode
+   fun:pthread_cancel_init
+}
 
 #
 # These seem to be libc threading stuff, not related to MySQL code (allocations

=== modified file 'sql/handler.h'
--- a/sql/handler.h	2008-06-30 20:21:41 +0000
+++ b/sql/handler.h	2008-08-13 09:18:28 +0000
@@ -2099,7 +2099,7 @@ public:
     @param    thd               The thread handle
     @param    table             The altered table, re-opened
  */
- virtual int alter_table_phase3(THD *thd, TABLE *table)
+ virtual int alter_table_phase3(THD *, TABLE *)
  {
    return HA_ERR_UNSUPPORTED;
  }

=== modified file 'sql/mdl.cc'
--- a/sql/mdl.cc	2008-06-20 13:11:20 +0000
+++ b/sql/mdl.cc	2008-08-12 10:59:30 +0000
@@ -19,6 +19,7 @@
 #include <hash.h>
 #include <mysqld_error.h>
 
+static bool mdl_initialized= 0;
 
 /**
    The lock context. Created internally for an acquired lock.
@@ -115,6 +116,7 @@ extern "C" uchar *mdl_locks_key(const uc
 
 void mdl_init()
 {
+  mdl_initialized= 1;
   pthread_mutex_init(&LOCK_mdl, NULL);
   pthread_cond_init(&COND_mdl, NULL);
   hash_init(&mdl_locks, &my_charset_bin, 16 /* FIXME */, 0, 0,
@@ -133,10 +135,14 @@ void mdl_init()
 
 void mdl_destroy()
 {
-  DBUG_ASSERT(!mdl_locks.records);
-  pthread_mutex_destroy(&LOCK_mdl);
-  pthread_cond_destroy(&COND_mdl);
-  hash_free(&mdl_locks);
+  if (mdl_initialized)
+  {
+    mdl_initialized= 0;
+    DBUG_ASSERT(!mdl_locks.records);
+    pthread_mutex_destroy(&LOCK_mdl);
+    pthread_cond_destroy(&COND_mdl);
+    hash_free(&mdl_locks);
+  }
 }
 
 

=== modified file 'sql/sql_base.cc'
--- a/sql/sql_base.cc	2008-07-09 14:27:18 +0000
+++ b/sql/sql_base.cc	2008-08-13 09:00:54 +0000
@@ -2030,8 +2030,6 @@ bool wait_while_table_is_used(THD *thd, 
                        table->s->table_name.str, table->s,
                        table->db_stat, table->s->version));
 
-  (void) table->file->extra(function);
-
   old_lock_type= table->reginfo.lock_type;
   mysql_lock_abort(thd, table, TRUE);	/* end threads waiting on lock */
 
@@ -2046,6 +2044,8 @@ bool wait_while_table_is_used(THD *thd, 
   tdc_remove_table(thd, TDC_RT_REMOVE_NOT_OWN,
                    table->s->db.str, table->s->table_name.str);
   pthread_mutex_unlock(&LOCK_open);
+  /* extra() call must come only after all instances above are closed */
+  (void) table->file->extra(function);
   DBUG_RETURN(FALSE);
 }
 

=== modified file 'sql/sql_select.cc'
--- a/sql/sql_select.cc	2008-07-10 23:29:27 +0000
+++ b/sql/sql_select.cc	2008-08-12 13:22:05 +0000
@@ -12937,7 +12937,8 @@ static bool create_internal_tmp_table(TA
 bool create_internal_tmp_table_from_heap(THD *thd, TABLE *table,
                                          ENGINE_COLUMNDEF *start_recinfo,
                                          ENGINE_COLUMNDEF **recinfo, 
-                                         int error, bool ignore_last_dupp_key_error)
+                                         int error,
+                                         bool ignore_last_dupp_key_error)
 {
   return create_internal_tmp_table_from_heap2(thd, table,
                                               start_recinfo, recinfo, error,

=== modified file 'sql/sql_table.cc'
--- a/sql/sql_table.cc	2008-07-09 07:12:43 +0000
+++ b/sql/sql_table.cc	2008-08-13 09:00:54 +0000
@@ -5788,7 +5788,7 @@ mysql_fast_or_online_alter_table(THD *th
     Upgrade the shared metadata lock to exclusive and close all
     instances of the table in the TDC except those used in this thread.
   */
-  if (wait_while_table_is_used(thd, table, HA_EXTRA_FORCE_REOPEN))
+  if (wait_while_table_is_used(thd, table, HA_EXTRA_PREPARE_FOR_RENAME))
     DBUG_RETURN(1);
 
   alter_table_manage_keys(table, table->file->indexes_are_disabled(),
@@ -7012,7 +7012,6 @@ view_err:
   if (wait_while_table_is_used(thd, table, HA_EXTRA_PREPARE_FOR_RENAME))
     goto err_new_table_cleanup;
 
-
   close_all_tables_for_name(thd, table->s,
                             new_name != table_name || new_db != db);
 

=== modified file 'storage/maria/ha_maria.cc'
--- a/storage/maria/ha_maria.cc	2008-07-10 14:58:31 +0000
+++ b/storage/maria/ha_maria.cc	2008-08-12 10:59:30 +0000
@@ -1847,6 +1847,7 @@ bool ha_maria::is_crashed() const
 
 int ha_maria::update_row(const uchar * old_data, uchar * new_data)
 {
+  DBUG_ASSERT(file->lock.type != TL_WRITE_CONCURRENT_INSERT);
   ha_statistic_increment(&SSV::ha_update_count);
   if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_UPDATE)
     table->timestamp_field->set_time();
@@ -1856,6 +1857,7 @@ int ha_maria::update_row(const uchar * o
 
 int ha_maria::delete_row(const uchar * buf)
 {
+  DBUG_ASSERT(file->lock.type != TL_WRITE_CONCURRENT_INSERT);
   ha_statistic_increment(&SSV::ha_delete_count);
   return maria_delete(file, buf);
 }
@@ -2389,6 +2391,7 @@ THR_LOCK_DATA **ha_maria::store_lock(THD
               (lock_type == TL_IGNORE || file->lock.type == TL_UNLOCK));
   if (lock_type != TL_IGNORE && file->lock.type == TL_UNLOCK)
   {
+    const enum enum_sql_command sql_command= thd->lex->sql_command;
     /*
       We have to disable concurrent inserts for INSERT ... SELECT or
       INSERT/UPDATE/DELETE with sub queries if we are using statement based
@@ -2397,24 +2400,33 @@ THR_LOCK_DATA **ha_maria::store_lock(THD
     */
     if (lock_type <= TL_READ_HIGH_PRIORITY &&
         !thd->current_stmt_binlog_row_based &&
-        (thd->lex->sql_command != SQLCOM_SELECT &&
-         thd->lex->sql_command != SQLCOM_LOCK_TABLES) &&
+        (sql_command != SQLCOM_SELECT &&
+         sql_command != SQLCOM_LOCK_TABLES) &&
         (thd->options & OPTION_BIN_LOG) &&
         mysql_bin_log.is_open())
       lock_type= TL_READ_NO_INSERT;
-    else if (lock_type == TL_WRITE_CONCURRENT_INSERT &&
-             (file->state->records == 0))
+    else if (lock_type == TL_WRITE_CONCURRENT_INSERT)
     {
+      const enum enum_duplicates duplicates= thd->lex->duplicates;
       /*
-        Bulk insert may use repair, which will cause problems if other
+        Explanation for the 3 conditions below, in order:
+
+        - Bulk insert may use repair, which will cause problems if other
         threads try to read/insert to the table: disable versioning.
         Note that our read of file->state->records is incorrect, as such
         variable may have changed when we come to start_bulk_insert() (worse
         case: we see != 0 so allow versioning, start_bulk_insert() sees 0 and
         uses repair). This is prevented because start_bulk_insert() will not
         try repair if we enabled versioning.
+        - INSERT SELECT ON DUPLICATE KEY UPDATE comes here with
+        TL_WRITE_CONCURRENT_INSERT but shouldn't because it can do
+        update/delete of a row and versioning doesn't support that
+        - same for LOAD DATA CONCURRENT REPLACE.
       */
-      lock_type= TL_WRITE;
+      if ((file->state->records == 0) ||
+          (sql_command == SQLCOM_INSERT_SELECT && duplicates == DUP_UPDATE) ||
+          (sql_command == SQLCOM_LOAD && duplicates == DUP_REPLACE))
+        lock_type= TL_WRITE;
     }
     file->lock.type= lock_type;
   }

=== modified file 'storage/maria/ma_blockrec.c'
--- a/storage/maria/ma_blockrec.c	2008-07-09 13:09:30 +0000
+++ b/storage/maria/ma_blockrec.c	2008-08-11 14:40:32 +0000
@@ -3073,7 +3073,7 @@ static my_bool write_block_record(MARIA_
     }
     else
     {
-      if (my_multi_malloc(MY_WME, &log_array,
+      if (!my_multi_malloc(MY_WME, &log_array,
                           (uint) ((bitmap_blocks->count +
                                    TRANSLOG_INTERNAL_PARTS + 2) *
                                   sizeof(*log_array)),

=== modified file 'storage/maria/ma_extra.c'
--- a/storage/maria/ma_extra.c	2008-06-26 05:18:28 +0000
+++ b/storage/maria/ma_extra.c	2008-08-12 10:59:30 +0000
@@ -322,6 +322,13 @@ int maria_extra(MARIA_HA *info, enum ha_
     if (share->kfile.file >= 0)
       _ma_decrement_open_count(info);
     pthread_mutex_lock(&share->intern_lock);
+    if (info->trn)
+    {
+      _ma_remove_table_from_trnman(share, info->trn);
+      /* Ensure we don't point to the deleted data in trn */
+      info->state= info->state_start= &share->state.state;
+    }
+
     type= do_flush ? FLUSH_RELEASE : FLUSH_IGNORE_CHANGED;
     if (_ma_flush_table_files(info, MARIA_FLUSH_DATA | MARIA_FLUSH_INDEX,
                               type, type))

=== modified file 'storage/maria/ma_recovery.c'
--- a/storage/maria/ma_recovery.c	2008-07-09 21:25:29 +0000
+++ b/storage/maria/ma_recovery.c	2008-08-12 10:59:30 +0000
@@ -3234,6 +3234,16 @@ void _ma_tmp_disable_logging_for_table(M
 
   /* if we disabled before writing the record, record wouldn't reach log */
   share->now_transactional= FALSE;
+
+  /*
+    Reset state pointers. This is needed as in ALTER table we may do
+    commit fllowed by _ma_renable_logging_for_table and then
+    info->state may point to a state that was deleted by
+    _ma_trnman_end_trans_hook()
+   */
+  share->state.common= *info->state;
+  info->state= &share->state.common;
+
   /*
     Some code in ma_blockrec.c assumes a trn even if !now_transactional but in
     this case it only reads trn->rec_lsn, which has to be LSN_IMPOSSIBLE and
@@ -3275,6 +3285,7 @@ my_bool _ma_reenable_logging_for_table(M
       in not transactional mode
     */
     _ma_copy_nontrans_state_information(info);
+    _ma_reset_history(info->s);
 
     if (flush_pages)
     {

=== modified file 'storage/maria/ma_state.c'
--- a/storage/maria/ma_state.c	2008-07-05 11:03:21 +0000
+++ b/storage/maria/ma_state.c	2008-07-12 14:14:28 +0000
@@ -371,7 +371,7 @@ my_bool _ma_trnman_end_trans_hook(TRN *t
       MARIA_STATE_HISTORY *history;
 
       pthread_mutex_lock(&share->intern_lock);
-      if (active_transactions &&
+      if (active_transactions && share->now_transactional &&
           trnman_exists_active_transactions(share->state_history->trid,
                                             trn->commit_trid, 1))
       {
@@ -415,6 +415,35 @@ my_bool _ma_trnman_end_trans_hook(TRN *t
 }
 
 
+/**
+   Remove table from trnman_list
+
+   @notes
+     This is used when we unlock a table from a group of locked tables
+     just before doing a rename or drop table.
+*/
+
+void _ma_remove_table_from_trnman(MARIA_SHARE *share, TRN *trn)
+{
+  MARIA_USED_TABLES *tables, **prev;
+  
+  for (prev= (MARIA_USED_TABLES**) &trn->used_tables, tables= *prev;
+       tables;
+       tables= *prev)
+  {
+    if (tables->share == share)
+    {
+      *prev= tables->next;
+      my_free(tables, MYF(0));
+    }
+    else
+      prev= &tables->next;
+  }
+}
+
+
+
+
 /****************************************************************************
   The following functions are called by thr_lock() in threaded applications
   for transactional tables.
@@ -509,6 +538,23 @@ void _ma_copy_nontrans_state_information
 }
 
 
+void _ma_reset_history(MARIA_SHARE *share)
+{
+  MARIA_STATE_HISTORY *history, *next;
+
+  share->state_history->trid= 0;          /* Visibly by all */
+  share->state_history->state= share->state.state;
+  history= share->state_history->next;
+  share->state_history->next= 0;
+
+  for (; history; history= next)
+  {
+    next= history->next;
+    my_free(history, MYF(0));
+  }
+}
+
+
 /****************************************************************************
   Virtual functions to check if row is visible
 ****************************************************************************/

=== modified file 'storage/maria/ma_state.h'
--- a/storage/maria/ma_state.h	2008-07-05 11:03:21 +0000
+++ b/storage/maria/ma_state.h	2008-07-12 14:14:28 +0000
@@ -77,3 +77,5 @@ my_bool _ma_row_visible_always(MARIA_HA 
 my_bool _ma_row_visible_non_transactional_table(MARIA_HA *info);
 my_bool _ma_row_visible_transactional_table(MARIA_HA *info);
 void _ma_remove_not_visible_states_with_lock(struct st_maria_share *share);
+void _ma_remove_table_from_trnman(struct st_maria_share *share, TRN *trn);
+void _ma_reset_history(struct st_maria_share *share);

Thread
bzr push into mysql-6.0 branch (monty:2685 to 2686) Michael Widenius13 Aug