diff --git a/Docs/Makefile.am b/Docs/Makefile.am index 629618609a3..24f921a4877 100644 --- a/Docs/Makefile.am +++ b/Docs/Makefile.am @@ -19,11 +19,24 @@ EXTRA_DIST = mysql.info INSTALL-BINARY @extra_docs@ # automake only seems to take care of this automatically, # if we're building the info page from texi directly. install-data-hook: $(srcdir)/mysql.info - $(mkinstalldirs) $(DESTDIR)$(infodir) - $(INSTALL_DATA) $(srcdir)/mysql.info $(DESTDIR)$(infodir) + if test `basename $(prefix)` = "mysql" ; then \ + $(mkinstalldirs) $(DESTDIR)$(prefix)/docs ; \ + $(INSTALL_DATA) $(srcdir)/mysql.info $(DESTDIR)$(prefix)/docs ; \ + test ! -f $(top_srcdir)/ChangeLog || $(INSTALL_DATA) $(top_srcdir)/ChangeLog $(DESTDIR)$(prefix)/docs ; \ + else \ + $(mkinstalldirs) $(DESTDIR)$(infodir) $(DESTDIR)$(pkgdatadir) ; \ + $(INSTALL_DATA) $(srcdir)/mysql.info $(DESTDIR)$(infodir) ; \ + test ! -f $(top_srcdir)/ChangeLog || $(INSTALL_DATA) $(top_srcdir)/ChangeLog $(DESTDIR)$(pkgdatadir) ; \ + fi uninstall-local: - @RM@ -f $(DESTDIR)$(infodir)/mysql.info + if test `basename $(prefix)` = "mysql" ; then \ + @RM@ -f $(DESTDIR)$(prefix)/docs/mysql.info ; \ + @RM@ -f $(DESTDIR)$(prefix)/docs/ChangeLog ; \ + else \ + @RM@ -f $(DESTDIR)$(infodir)/mysql.info ; \ + @RM@ -f $(DESTDIR)$(pkgdatadir)/ChangeLog ; \ + fi # Don't update the files from bitkeeper %::SCCS/s.% diff --git a/Makefile.am b/Makefile.am index ad94c9ea325..60b4f9bd07c 100644 --- a/Makefile.am +++ b/Makefile.am @@ -132,15 +132,33 @@ test-bt: -cd mysql-test ; MTR_BUILD_THREAD=auto \ @PERL@ ./mysql-test-run.pl --comment=ps --force --timer \ --skip-ndbcluster --ps-protocol + -if [ -e bin/ndbd -o -e storage/ndb/src/kernel/ndbd ] ; then \ + cd mysql-test ; \ + MTR_BUILD_THREAD=auto \ + @PERL@ ./mysql-test-run.pl --comment=ndb+rpl_ndb+ps --force --timer \ + --ps-protocol --mysqld=--binlog-format=row --suite=ndb,rpl_ndb ; \ + MTR_BUILD_THREAD=auto \ + @PERL@ ./mysql-test-run.pl --comment=ndb --force --timer \ + --with-ndbcluster-only ; \ + else \ + echo "no program found for 'ndbcluster' tests - skipped testing" ; \ + fi -cd mysql-test ; MTR_BUILD_THREAD=auto \ - @PERL@ ./mysql-test-run.pl --comment=normal+rowrepl --force --timer \ - --skip-ndbcluster --mysqld=--binlog-format=row + @PERL@ ./mysql-test-run.pl --force --comment=funcs1+ps --ps-protocol --suite=funcs_1 -cd mysql-test ; MTR_BUILD_THREAD=auto \ - @PERL@ ./mysql-test-run.pl --comment=ps+rowrepl+NDB --force --timer \ - --ps-protocol --mysqld=--binlog-format=row + @PERL@ ./mysql-test-run.pl --force --comment=funcs2 --suite=funcs_2 -cd mysql-test ; MTR_BUILD_THREAD=auto \ - @PERL@ ./mysql-test-run.pl --comment=NDB --force --timer \ - --with-ndbcluster-only + @PERL@ ./mysql-test-run.pl --force --comment=partitions --suite=parts + -cd mysql-test ; MTR_BUILD_THREAD=auto \ + @PERL@ ./mysql-test-run.pl --force --comment=stress --suite=stress + -if [ -d mysql-test/suite/nist ] ; then \ + cd mysql-test ; MTR_BUILD_THREAD=auto \ + @PERL@ ./mysql-test-run.pl --comment=nist --force --suite=nist ; \ + fi + -if [ -d mysql-test/suite/nist ] ; then \ + cd mysql-test ; MTR_BUILD_THREAD=auto \ + @PERL@ ./mysql-test-run.pl --comment=nist+ps --force --suite=nist --ps-protocol ; \ + fi -if [ -e bin/mysqltest_embedded -o -e libmysqld/examples/mysqltest_embedded ] ; then \ cd mysql-test ; MTR_BUILD_THREAD=auto \ @PERL@ ./mysql-test-run.pl --comment=embedded --force --timer \ @@ -148,24 +166,6 @@ test-bt: else \ echo "no program found for 'embedded' tests - skipped testing" ; \ fi - -cd mysql-test ; MTR_BUILD_THREAD=auto \ - @PERL@ ./mysql-test-run.pl --force --comment=funcs1_ps --ps-protocol --suite=funcs_1 - -cd mysql-test ; MTR_BUILD_THREAD=auto \ - @PERL@ ./mysql-test-run.pl --force --comment=funcs2 --suite=funcs_2 - -cd mysql-test ; MTR_BUILD_THREAD=auto \ - @PERL@ ./mysql-test-run.pl --force --comment=rpl --suite=rpl - -cd mysql-test ; MTR_BUILD_THREAD=auto \ - @PERL@ ./mysql-test-run.pl --force --comment=partitions --suite=parts - -if [ -d mysql-test/suite/nist ] ; then \ - cd mysql-test ; MTR_BUILD_THREAD=auto \ - @PERL@ ./mysql-test-run.pl --comment=NIST+normal --force --suite=nist ; \ - fi - -if [ -d mysql-test/suite/nist ] ; then \ - cd mysql-test ; MTR_BUILD_THREAD=auto \ - @PERL@ ./mysql-test-run.pl --comment=NIST+ps --force --suite=nist --ps-protocol ; \ - fi - -cd mysql-test ; MTR_BUILD_THREAD=auto \ - @PERL@ ./mysql-test-run.pl --force --comment=stress --suite=stress # Re-enable the "jp" suite when bug#28563 is fixed # -cd mysql-test ; MTR_BUILD_THREAD=auto \ diff --git a/libmysqld/CMakeLists.txt b/libmysqld/CMakeLists.txt index b1895e98014..fb7b214bf60 100644 --- a/libmysqld/CMakeLists.txt +++ b/libmysqld/CMakeLists.txt @@ -187,7 +187,7 @@ SET(LIBMYSQLD_SOURCES emb_qcache.cc libmysqld.c lib_sql.cc ../sql/strfunc.cc ../sql/table.cc ../sql/thr_malloc.cc ../sql/time.cc ../sql/tztime.cc ../sql/uniques.cc ../sql/unireg.cc ../sql/partition_info.cc ../sql/sql_connect.cc - ../sql/scheduler.cc + ../sql/scheduler.cc ../sql/stacktrace.c ${GEN_SOURCES} ${LIB_SOURCES}) diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc index ec9356ce98d..0f0fb2c1bda 100644 --- a/libmysqld/lib_sql.cc +++ b/libmysqld/lib_sql.cc @@ -1124,6 +1124,9 @@ bool Protocol::net_store_data(const uchar *from, size_t length) return FALSE; } +#if defined(_MSC_VER) && _MSC_VER < 1400 +#define vsnprintf _vsnprintf +#endif int vprint_msg_to_log(enum loglevel level __attribute__((unused)), const char *format, va_list argsi) diff --git a/mysql-test/include/master-slave-reset.inc b/mysql-test/include/master-slave-reset.inc index 204c6c5f5f6..1363fab236a 100644 --- a/mysql-test/include/master-slave-reset.inc +++ b/mysql-test/include/master-slave-reset.inc @@ -3,7 +3,7 @@ connection slave; #(the server was started with skip-slave-start) --disable_warnings stop slave; ---wait_for_slave_to_stop +source include/wait_for_slave_to_stop.inc; --enable_warnings connection master; --disable_warnings @@ -20,3 +20,4 @@ reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; --enable_warnings start slave; +source include/wait_for_slave_to_start.inc; diff --git a/mysql-test/r/query_cache_debug.result b/mysql-test/r/query_cache_debug.result index f177bfac836..c90165368e3 100644 --- a/mysql-test/r/query_cache_debug.result +++ b/mysql-test/r/query_cache_debug.result @@ -1,6 +1,6 @@ flush status; set query_cache_type=DEMAND; -set global query_cache_size= 1024*1024*512; +set global query_cache_size= 1024*768; drop table if exists t1; create table t1 (a varchar(100)); insert into t1 values ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb'); diff --git a/mysql-test/r/read_only_innodb.result b/mysql-test/r/read_only_innodb.result index d028e3cc207..690de085bf9 100644 --- a/mysql-test/r/read_only_innodb.result +++ b/mysql-test/r/read_only_innodb.result @@ -16,3 +16,33 @@ ERROR HY000: The MySQL server is running with the --read-only option so it canno set global read_only=0; drop table table_11733 ; drop user test@localhost; +GRANT CREATE, SELECT, DROP ON *.* TO test@localhost; +CREATE TABLE t1(a INT) ENGINE=INNODB; +INSERT INTO t1 VALUES (0), (1); +SET GLOBAL read_only=1; +SELECT * FROM t1; +a +0 +1 +BEGIN; +SELECT * FROM t1; +a +0 +1 +COMMIT; +SET GLOBAL read_only=0; +FLUSH TABLES WITH READ LOCK; +SELECT * FROM t1; +a +0 +1 +BEGIN; +SELECT * FROM t1; +a +0 +1 +COMMIT; +UNLOCK TABLES; +DROP TABLE t1; +DROP USER test@localhost; +echo End of 5.1 tests diff --git a/mysql-test/suite/funcs_1/r/charset_collation_3.result b/mysql-test/suite/funcs_1/r/charset_collation_3.result index b9a2dbe8a98..55ed4b4704c 100644 --- a/mysql-test/suite/funcs_1/r/charset_collation_3.result +++ b/mysql-test/suite/funcs_1/r/charset_collation_3.result @@ -47,10 +47,10 @@ SELECT * FROM information_schema.collations ORDER BY collation_name; COLLATION_NAME CHARACTER_SET_NAME ID IS_DEFAULT IS_COMPILED SORTLEN -armscii8_bin armscii8 64 Yes 1 -armscii8_general_ci armscii8 32 Yes Yes 1 -ascii_bin ascii 65 Yes 1 -ascii_general_ci ascii 11 Yes Yes 1 +armscii8_bin armscii8 64 0 +armscii8_general_ci armscii8 32 Yes 0 +ascii_bin ascii 65 0 +ascii_general_ci ascii 11 Yes 0 big5_bin big5 84 Yes 1 big5_chinese_ci big5 1 Yes Yes 1 binary binary 63 Yes Yes 1 @@ -58,26 +58,27 @@ cp1250_bin cp1250 66 Yes 1 cp1250_croatian_ci cp1250 44 Yes 1 cp1250_czech_cs cp1250 34 Yes 2 cp1250_general_ci cp1250 26 Yes Yes 1 -cp1251_bin cp1251 50 Yes 1 -cp1251_bulgarian_ci cp1251 14 Yes 1 -cp1251_general_ci cp1251 51 Yes Yes 1 -cp1251_general_cs cp1251 52 Yes 1 -cp1251_ukrainian_ci cp1251 23 Yes 1 -cp1256_bin cp1256 67 Yes 1 -cp1256_general_ci cp1256 57 Yes Yes 1 -cp1257_bin cp1257 58 Yes 1 -cp1257_general_ci cp1257 59 Yes Yes 1 -cp1257_lithuanian_ci cp1257 29 Yes 1 -cp850_bin cp850 80 Yes 1 -cp850_general_ci cp850 4 Yes Yes 1 -cp852_bin cp852 81 Yes 1 -cp852_general_ci cp852 40 Yes Yes 1 -cp866_bin cp866 68 Yes 1 -cp866_general_ci cp866 36 Yes Yes 1 +cp1250_polish_ci cp1250 99 Yes 1 +cp1251_bin cp1251 50 0 +cp1251_bulgarian_ci cp1251 14 0 +cp1251_general_ci cp1251 51 Yes 0 +cp1251_general_cs cp1251 52 0 +cp1251_ukrainian_ci cp1251 23 0 +cp1256_bin cp1256 67 0 +cp1256_general_ci cp1256 57 Yes 0 +cp1257_bin cp1257 58 0 +cp1257_general_ci cp1257 59 Yes 0 +cp1257_lithuanian_ci cp1257 29 0 +cp850_bin cp850 80 0 +cp850_general_ci cp850 4 Yes 0 +cp852_bin cp852 81 0 +cp852_general_ci cp852 40 Yes 0 +cp866_bin cp866 68 0 +cp866_general_ci cp866 36 Yes 0 cp932_bin cp932 96 Yes 1 cp932_japanese_ci cp932 95 Yes Yes 1 -dec8_bin dec8 69 Yes 1 -dec8_swedish_ci dec8 3 Yes Yes 1 +dec8_bin dec8 69 0 +dec8_swedish_ci dec8 3 Yes 0 eucjpms_bin eucjpms 98 Yes 1 eucjpms_japanese_ci eucjpms 97 Yes Yes 1 euckr_bin euckr 85 Yes 1 @@ -86,20 +87,20 @@ gb2312_bin gb2312 86 Yes 1 gb2312_chinese_ci gb2312 24 Yes Yes 1 gbk_bin gbk 87 Yes 1 gbk_chinese_ci gbk 28 Yes Yes 1 -geostd8_bin geostd8 93 Yes 1 -geostd8_general_ci geostd8 92 Yes Yes 1 -greek_bin greek 70 Yes 1 -greek_general_ci greek 25 Yes Yes 1 -hebrew_bin hebrew 71 Yes 1 -hebrew_general_ci hebrew 16 Yes Yes 1 -hp8_bin hp8 72 Yes 1 -hp8_english_ci hp8 6 Yes Yes 1 -keybcs2_bin keybcs2 73 Yes 1 -keybcs2_general_ci keybcs2 37 Yes Yes 1 -koi8r_bin koi8r 74 Yes 1 -koi8r_general_ci koi8r 7 Yes Yes 1 -koi8u_bin koi8u 75 Yes 1 -koi8u_general_ci koi8u 22 Yes Yes 1 +geostd8_bin geostd8 93 0 +geostd8_general_ci geostd8 92 Yes 0 +greek_bin greek 70 0 +greek_general_ci greek 25 Yes 0 +hebrew_bin hebrew 71 0 +hebrew_general_ci hebrew 16 Yes 0 +hp8_bin hp8 72 0 +hp8_english_ci hp8 6 Yes 0 +keybcs2_bin keybcs2 73 0 +keybcs2_general_ci keybcs2 37 Yes 0 +koi8r_bin koi8r 74 0 +koi8r_general_ci koi8r 7 Yes 0 +koi8u_bin koi8u 75 0 +koi8u_general_ci koi8u 22 Yes 0 latin1_bin latin1 47 Yes 1 latin1_danish_ci latin1 15 Yes 1 latin1_general_ci latin1 48 Yes 1 @@ -113,20 +114,20 @@ latin2_croatian_ci latin2 27 Yes 1 latin2_czech_cs latin2 2 Yes 4 latin2_general_ci latin2 9 Yes Yes 1 latin2_hungarian_ci latin2 21 Yes 1 -latin5_bin latin5 78 Yes 1 -latin5_turkish_ci latin5 30 Yes Yes 1 -latin7_bin latin7 79 Yes 1 -latin7_estonian_cs latin7 20 Yes 1 -latin7_general_ci latin7 41 Yes Yes 1 -latin7_general_cs latin7 42 Yes 1 -macce_bin macce 43 Yes 1 -macce_general_ci macce 38 Yes Yes 1 -macroman_bin macroman 53 Yes 1 -macroman_general_ci macroman 39 Yes Yes 1 +latin5_bin latin5 78 0 +latin5_turkish_ci latin5 30 Yes 0 +latin7_bin latin7 79 0 +latin7_estonian_cs latin7 20 0 +latin7_general_ci latin7 41 Yes 0 +latin7_general_cs latin7 42 0 +macce_bin macce 43 0 +macce_general_ci macce 38 Yes 0 +macroman_bin macroman 53 0 +macroman_general_ci macroman 39 Yes 0 sjis_bin sjis 88 Yes 1 sjis_japanese_ci sjis 13 Yes Yes 1 -swe7_bin swe7 82 Yes 1 -swe7_swedish_ci swe7 10 Yes Yes 1 +swe7_bin swe7 82 0 +swe7_swedish_ci swe7 10 Yes 0 tis620_bin tis620 89 Yes 1 tis620_thai_ci tis620 18 Yes Yes 4 ucs2_bin ucs2 90 Yes 1 @@ -190,6 +191,7 @@ cp1250_bin cp1250 cp1250_croatian_ci cp1250 cp1250_czech_cs cp1250 cp1250_general_ci cp1250 +cp1250_polish_ci cp1250 cp1251_bin cp1251 cp1251_bulgarian_ci cp1251 cp1251_general_ci cp1251 @@ -214,6 +216,7 @@ eucjpms_bin eucjpms eucjpms_japanese_ci eucjpms euckr_bin euckr euckr_korean_ci euckr +filename filename gb2312_bin gb2312 gb2312_chinese_ci gb2312 gbk_bin gbk diff --git a/mysql-test/suite/funcs_1/r/innodb_storedproc.result b/mysql-test/suite/funcs_1/r/innodb_storedproc.result index c20276b1937..18579f3c275 100644 --- a/mysql-test/suite/funcs_1/r/innodb_storedproc.result +++ b/mysql-test/suite/funcs_1/r/innodb_storedproc.result @@ -14309,10 +14309,7 @@ declare continue handler for cond1 set @var2 = 1; set @x=1; SELECT @var2; END// -CALL sp1(); -@var2 -NULL -DROP PROCEDURE sp1; +ERROR 42000: Bad SQLSTATE: '00000' Testcase 4.2.45: -------------------------------------------------------------------------------- @@ -14387,10 +14384,7 @@ declare continue handler for sqlstate '00000' set @var2 = 1; set @x=1; SELECT @var2; END// -CALL sp1(); -@var2 -NULL -DROP PROCEDURE sp1; +ERROR 42000: Bad SQLSTATE: '00000' Testcase 4.2.52: -------------------------------------------------------------------------------- @@ -23493,6 +23487,7 @@ set x1 = 2; END; SELECT @x, x1; END// +ERROR 42000: Bad SQLSTATE: '00000' DROP PROCEDURE IF EXISTS h1; Testcase 4.11.40: @@ -23530,9 +23525,9 @@ set x1 = 2; END; SELECT @x, x1; END// +ERROR 42000: Bad SQLSTATE: '00000' CALL h1(); -@x x1 -0 2 +ERROR 42000: PROCEDURE db_storedproc.h1 does not exist DROP PROCEDURE IF EXISTS h1; * Testcase 3.1.2.53 (4.11.42): diff --git a/mysql-test/suite/funcs_1/r/innodb_storedproc_02.result b/mysql-test/suite/funcs_1/r/innodb_storedproc_02.result index 49f70d55676..50fa295e94f 100644 --- a/mysql-test/suite/funcs_1/r/innodb_storedproc_02.result +++ b/mysql-test/suite/funcs_1/r/innodb_storedproc_02.result @@ -586,14 +586,9 @@ SELECT @var3, @var4; END begin2_label; SELECT @var1, @var2; END begin1_label// -CALL sp1(); -@var3 @var4 -NULL 8 -@var1 @var2 -NULL 6 +ERROR 42000: Bad SQLSTATE: '00000' DROP PROCEDURE p1; DROP PROCEDURE h1; -DROP PROCEDURE sp1; DROP TABLE res_t1; Testcase 3.1.2.50: diff --git a/mysql-test/suite/funcs_1/r/innodb_trig_03e.result b/mysql-test/suite/funcs_1/r/innodb_trig_03e.result index 048c070ea96..26546138ea2 100644 --- a/mysql-test/suite/funcs_1/r/innodb_trig_03e.result +++ b/mysql-test/suite/funcs_1/r/innodb_trig_03e.result @@ -1214,7 +1214,7 @@ create definer=not_ex_user@localhost trigger trg1_0 before INSERT on t1 for each row set new.f1 = 'trig 1_0-yes'; Warnings: -Note 1449 There is no 'not_ex_user'@'localhost' registered +Note 1449 The user specified as a definer ('not_ex_user'@'localhost') does not exist drop trigger trg1_0; create definer=test_yesprivs@localhost trigger trg1_0 before INSERT on t1 for each row diff --git a/mysql-test/suite/funcs_1/r/is_columns_is.result b/mysql-test/suite/funcs_1/r/is_columns_is.result index e2081af7e00..c1813a1add2 100644 --- a/mysql-test/suite/funcs_1/r/is_columns_is.result +++ b/mysql-test/suite/funcs_1/r/is_columns_is.result @@ -176,7 +176,7 @@ NULL information_schema REFERENTIAL_CONSTRAINTS MATCH_OPTION 7 NO varchar 64 19 NULL information_schema REFERENTIAL_CONSTRAINTS REFERENCED_TABLE_NAME 11 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select NULL information_schema REFERENTIAL_CONSTRAINTS TABLE_NAME 10 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select NULL information_schema REFERENTIAL_CONSTRAINTS UNIQUE_CONSTRAINT_CATALOG 4 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) select -NULL information_schema REFERENTIAL_CONSTRAINTS UNIQUE_CONSTRAINT_NAME 6 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select +NULL information_schema REFERENTIAL_CONSTRAINTS UNIQUE_CONSTRAINT_NAME 6 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select NULL information_schema REFERENTIAL_CONSTRAINTS UNIQUE_CONSTRAINT_SCHEMA 5 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select NULL information_schema REFERENTIAL_CONSTRAINTS UPDATE_RULE 8 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select NULL information_schema ROUTINES CHARACTER_SET_CLIENT 21 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select diff --git a/mysql-test/suite/funcs_1/r/memory_storedproc.result b/mysql-test/suite/funcs_1/r/memory_storedproc.result index a8294aa3e27..3e22ef2593f 100644 --- a/mysql-test/suite/funcs_1/r/memory_storedproc.result +++ b/mysql-test/suite/funcs_1/r/memory_storedproc.result @@ -14309,10 +14309,7 @@ declare continue handler for cond1 set @var2 = 1; set @x=1; SELECT @var2; END// -CALL sp1(); -@var2 -NULL -DROP PROCEDURE sp1; +ERROR 42000: Bad SQLSTATE: '00000' Testcase 4.2.45: -------------------------------------------------------------------------------- @@ -14387,10 +14384,7 @@ declare continue handler for sqlstate '00000' set @var2 = 1; set @x=1; SELECT @var2; END// -CALL sp1(); -@var2 -NULL -DROP PROCEDURE sp1; +ERROR 42000: Bad SQLSTATE: '00000' Testcase 4.2.52: -------------------------------------------------------------------------------- @@ -23471,6 +23465,7 @@ set x1 = 2; END; SELECT @x, x1; END// +ERROR 42000: Bad SQLSTATE: '00000' DROP PROCEDURE IF EXISTS h1; Testcase 4.11.40: @@ -23508,9 +23503,9 @@ set x1 = 2; END; SELECT @x, x1; END// +ERROR 42000: Bad SQLSTATE: '00000' CALL h1(); -@x x1 -0 2 +ERROR 42000: PROCEDURE db_storedproc.h1 does not exist DROP PROCEDURE IF EXISTS h1; * Testcase 3.1.2.53 (4.11.42): diff --git a/mysql-test/suite/funcs_1/r/memory_storedproc_02.result b/mysql-test/suite/funcs_1/r/memory_storedproc_02.result index a76301ffa18..3476719c530 100644 --- a/mysql-test/suite/funcs_1/r/memory_storedproc_02.result +++ b/mysql-test/suite/funcs_1/r/memory_storedproc_02.result @@ -586,14 +586,9 @@ SELECT @var3, @var4; END begin2_label; SELECT @var1, @var2; END begin1_label// -CALL sp1(); -@var3 @var4 -NULL 8 -@var1 @var2 -NULL 6 +ERROR 42000: Bad SQLSTATE: '00000' DROP PROCEDURE p1; DROP PROCEDURE h1; -DROP PROCEDURE sp1; DROP TABLE res_t1; Testcase 3.1.2.50: diff --git a/mysql-test/suite/funcs_1/r/memory_trig_03e.result b/mysql-test/suite/funcs_1/r/memory_trig_03e.result index fad778ce7c0..251079f8638 100644 --- a/mysql-test/suite/funcs_1/r/memory_trig_03e.result +++ b/mysql-test/suite/funcs_1/r/memory_trig_03e.result @@ -1214,7 +1214,7 @@ create definer=not_ex_user@localhost trigger trg1_0 before INSERT on t1 for each row set new.f1 = 'trig 1_0-yes'; Warnings: -Note 1449 There is no 'not_ex_user'@'localhost' registered +Note 1449 The user specified as a definer ('not_ex_user'@'localhost') does not exist drop trigger trg1_0; create definer=test_yesprivs@localhost trigger trg1_0 before INSERT on t1 for each row diff --git a/mysql-test/suite/funcs_1/r/myisam_storedproc.result b/mysql-test/suite/funcs_1/r/myisam_storedproc.result index 2584807bcc6..8391a36e62e 100644 --- a/mysql-test/suite/funcs_1/r/myisam_storedproc.result +++ b/mysql-test/suite/funcs_1/r/myisam_storedproc.result @@ -14309,10 +14309,7 @@ declare continue handler for cond1 set @var2 = 1; set @x=1; SELECT @var2; END// -CALL sp1(); -@var2 -NULL -DROP PROCEDURE sp1; +ERROR 42000: Bad SQLSTATE: '00000' Testcase 4.2.45: -------------------------------------------------------------------------------- @@ -14387,10 +14384,7 @@ declare continue handler for sqlstate '00000' set @var2 = 1; set @x=1; SELECT @var2; END// -CALL sp1(); -@var2 -NULL -DROP PROCEDURE sp1; +ERROR 42000: Bad SQLSTATE: '00000' Testcase 4.2.52: -------------------------------------------------------------------------------- @@ -23493,6 +23487,7 @@ set x1 = 2; END; SELECT @x, x1; END// +ERROR 42000: Bad SQLSTATE: '00000' DROP PROCEDURE IF EXISTS h1; Testcase 4.11.40: @@ -23530,9 +23525,9 @@ set x1 = 2; END; SELECT @x, x1; END// +ERROR 42000: Bad SQLSTATE: '00000' CALL h1(); -@x x1 -0 2 +ERROR 42000: PROCEDURE db_storedproc.h1 does not exist DROP PROCEDURE IF EXISTS h1; * Testcase 3.1.2.53 (4.11.42): diff --git a/mysql-test/suite/funcs_1/r/myisam_storedproc_02.result b/mysql-test/suite/funcs_1/r/myisam_storedproc_02.result index e20b3ed22ba..5d7549b8b5a 100644 --- a/mysql-test/suite/funcs_1/r/myisam_storedproc_02.result +++ b/mysql-test/suite/funcs_1/r/myisam_storedproc_02.result @@ -586,14 +586,9 @@ SELECT @var3, @var4; END begin2_label; SELECT @var1, @var2; END begin1_label// -CALL sp1(); -@var3 @var4 -NULL 8 -@var1 @var2 -NULL 6 +ERROR 42000: Bad SQLSTATE: '00000' DROP PROCEDURE p1; DROP PROCEDURE h1; -DROP PROCEDURE sp1; DROP TABLE res_t1; Testcase 3.1.2.50: diff --git a/mysql-test/suite/funcs_1/r/myisam_trig_03e.result b/mysql-test/suite/funcs_1/r/myisam_trig_03e.result index bcd50198fca..68f8b2a0ef6 100644 --- a/mysql-test/suite/funcs_1/r/myisam_trig_03e.result +++ b/mysql-test/suite/funcs_1/r/myisam_trig_03e.result @@ -1214,7 +1214,7 @@ create definer=not_ex_user@localhost trigger trg1_0 before INSERT on t1 for each row set new.f1 = 'trig 1_0-yes'; Warnings: -Note 1449 There is no 'not_ex_user'@'localhost' registered +Note 1449 The user specified as a definer ('not_ex_user'@'localhost') does not exist drop trigger trg1_0; create definer=test_yesprivs@localhost trigger trg1_0 before INSERT on t1 for each row diff --git a/mysql-test/suite/funcs_1/r/ndb_storedproc.result b/mysql-test/suite/funcs_1/r/ndb_storedproc.result index 92cc86120d5..42886c69412 100644 --- a/mysql-test/suite/funcs_1/r/ndb_storedproc.result +++ b/mysql-test/suite/funcs_1/r/ndb_storedproc.result @@ -14309,10 +14309,7 @@ declare continue handler for cond1 set @var2 = 1; set @x=1; SELECT @var2; END// -CALL sp1(); -@var2 -NULL -DROP PROCEDURE sp1; +ERROR 42000: Bad SQLSTATE: '00000' Testcase 4.2.45: -------------------------------------------------------------------------------- @@ -14387,10 +14384,7 @@ declare continue handler for sqlstate '00000' set @var2 = 1; set @x=1; SELECT @var2; END// -CALL sp1(); -@var2 -NULL -DROP PROCEDURE sp1; +ERROR 42000: Bad SQLSTATE: '00000' Testcase 4.2.52: -------------------------------------------------------------------------------- @@ -23495,6 +23489,7 @@ set x1 = 2; END; SELECT @x, x1; END// +ERROR 42000: Bad SQLSTATE: '00000' DROP PROCEDURE IF EXISTS h1; Testcase 4.11.40: @@ -23532,9 +23527,9 @@ set x1 = 2; END; SELECT @x, x1; END// +ERROR 42000: Bad SQLSTATE: '00000' CALL h1(); -@x x1 -0 2 +ERROR 42000: PROCEDURE db_storedproc.h1 does not exist DROP PROCEDURE IF EXISTS h1; * Testcase 3.1.2.53 (4.11.42): diff --git a/mysql-test/suite/funcs_1/r/ndb_storedproc_02.result b/mysql-test/suite/funcs_1/r/ndb_storedproc_02.result index 419ade39c4f..032aef1d7e0 100644 --- a/mysql-test/suite/funcs_1/r/ndb_storedproc_02.result +++ b/mysql-test/suite/funcs_1/r/ndb_storedproc_02.result @@ -586,14 +586,9 @@ SELECT @var3, @var4; END begin2_label; SELECT @var1, @var2; END begin1_label// -CALL sp1(); -@var3 @var4 -NULL 8 -@var1 @var2 -NULL 6 +ERROR 42000: Bad SQLSTATE: '00000' DROP PROCEDURE p1; DROP PROCEDURE h1; -DROP PROCEDURE sp1; DROP TABLE res_t1; Testcase 3.1.2.50: diff --git a/mysql-test/suite/funcs_1/r/ndb_trig_03e.result b/mysql-test/suite/funcs_1/r/ndb_trig_03e.result index 0d097d6cd7c..2416732a129 100644 --- a/mysql-test/suite/funcs_1/r/ndb_trig_03e.result +++ b/mysql-test/suite/funcs_1/r/ndb_trig_03e.result @@ -1214,7 +1214,7 @@ create definer=not_ex_user@localhost trigger trg1_0 before INSERT on t1 for each row set new.f1 = 'trig 1_0-yes'; Warnings: -Note 1449 There is no 'not_ex_user'@'localhost' registered +Note 1449 The user specified as a definer ('not_ex_user'@'localhost') does not exist drop trigger trg1_0; create definer=test_yesprivs@localhost trigger trg1_0 before INSERT on t1 for each row diff --git a/mysql-test/suite/funcs_1/storedproc/storedproc_02.inc b/mysql-test/suite/funcs_1/storedproc/storedproc_02.inc index 2efc5a83663..756732b0e80 100644 --- a/mysql-test/suite/funcs_1/storedproc/storedproc_02.inc +++ b/mysql-test/suite/funcs_1/storedproc/storedproc_02.inc @@ -696,6 +696,7 @@ delimiter ;// CALL h1(); +--error ER_SP_BAD_SQLSTATE delimiter //; CREATE PROCEDURE sp1() begin1_label:BEGIN @@ -710,12 +711,9 @@ CREATE PROCEDURE sp1() END begin1_label// delimiter ;// -CALL sp1(); - # cleanup 3.1.2.45+50 DROP PROCEDURE p1; DROP PROCEDURE h1; -DROP PROCEDURE sp1; DROP TABLE res_t1; diff --git a/mysql-test/suite/funcs_1/storedproc/storedproc_master.inc b/mysql-test/suite/funcs_1/storedproc/storedproc_master.inc index 972e6e207a5..e48008316c1 100644 --- a/mysql-test/suite/funcs_1/storedproc/storedproc_master.inc +++ b/mysql-test/suite/funcs_1/storedproc/storedproc_master.inc @@ -17235,6 +17235,7 @@ DROP PROCEDURE IF EXISTS sp1; --enable_warnings delimiter //; +--error ER_SP_BAD_SQLSTATE CREATE PROCEDURE sp1() BEGIN declare cond1 condition for sqlstate '00000'; @@ -17244,11 +17245,6 @@ BEGIN END// delimiter ;// -CALL sp1(); - -# cleanup -DROP PROCEDURE sp1; - # ------------------------------------------------------------------------------ let $message= Testcase 4.2.45:; @@ -17388,6 +17384,7 @@ DROP PROCEDURE IF EXISTS sp1; --enable_warnings delimiter //; +--error ER_SP_BAD_SQLSTATE CREATE PROCEDURE sp1() BEGIN declare continue handler for sqlstate '00000' set @var2 = 1; @@ -17396,12 +17393,6 @@ BEGIN END// delimiter ;// -CALL sp1(); - -# cleanup -DROP PROCEDURE sp1; - - # ------------------------------------------------------------------------------ let $message= Testcase 4.2.52:; @@ -29245,6 +29236,7 @@ DROP PROCEDURE IF EXISTS h1; --enable_warnings delimiter //; +--error ER_SP_BAD_SQLSTATE CREATE PROCEDURE h1 () BEGIN declare x1 int default 0; @@ -29320,6 +29312,7 @@ DROP PROCEDURE IF EXISTS h1; --enable_warnings delimiter //; +--error ER_SP_BAD_SQLSTATE CREATE PROCEDURE h1 () BEGIN declare x1 int default 0; diff --git a/mysql-test/suite/rpl/r/rpl_row_create_table.result b/mysql-test/suite/rpl/r/rpl_row_create_table.result index ebfb576c42d..c4cf8353bca 100644 --- a/mysql-test/suite/rpl/r/rpl_row_create_table.result +++ b/mysql-test/suite/rpl/r/rpl_row_create_table.result @@ -417,3 +417,17 @@ Log_name Pos Event_type Server_id End_log_pos Info SELECT * FROM t2 ORDER BY a; a DROP TABLE t1,t2; +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (1),(1); +CREATE TABLE t2 (a INT UNIQUE) ENGINE=INNODB SELECT * FROM t1; +ERROR 23000: Duplicate entry '1' for key 'a' +INSERT INTO t1 VALUES (2); +*** the proof of the fix: +select must show that the last insert performed on the slave *** +SELECT * FROM t1; +a +1 +1 +2 +DROP TABLE t1; +end of the tests diff --git a/mysql-test/suite/rpl/t/disabled.def b/mysql-test/suite/rpl/t/disabled.def index 62acae3b15e..aaf1d2e7d7a 100644 --- a/mysql-test/suite/rpl/t/disabled.def +++ b/mysql-test/suite/rpl/t/disabled.def @@ -12,3 +12,4 @@ rpl_ddl : BUG#26418 2007-03-01 mleich Slave out of sync after CREATE/DROP TEMPORARY TABLE + ROLLBACK on master rpl_innodb_bug28430 : Bug #32247 2007-11-27 mats Test reports wrong value of "AUTO_INCREMENT" (on a partitioned InnoDB table) +rpl_redirect : Failure is sporadic and and the test is superfluous (mats) diff --git a/mysql-test/suite/rpl/t/rpl_insert.test b/mysql-test/suite/rpl/t/rpl_insert.test index 504ca1809ad..00e814951d5 100644 --- a/mysql-test/suite/rpl/t/rpl_insert.test +++ b/mysql-test/suite/rpl/t/rpl_insert.test @@ -18,10 +18,13 @@ let $query = "INSERT DELAYED INTO t1 VALUES (1, 'Dr. No'), (2, 'From Russia With # Wait until all the 5000 inserts has been inserted into the table let $wait_condition= SELECT COUNT(*) = 5000 FROM mysqlslap.t1; ---source include/wait_condition.inc - +source include/wait_condition.inc; SELECT COUNT(*) FROM mysqlslap.t1; -sync_slave_with_master; + +connection slave; +# Wait until all the 5000 inserts has been inserted into the table +let $wait_condition= SELECT COUNT(*) = 5000 FROM mysqlslap.t1; +source include/wait_condition.inc; SELECT COUNT(*) FROM mysqlslap.t1; --echo # diff --git a/mysql-test/suite/rpl/t/rpl_row_create_table.test b/mysql-test/suite/rpl/t/rpl_row_create_table.test index bfeb939f30f..e5cdfa4341a 100644 --- a/mysql-test/suite/rpl/t/rpl_row_create_table.test +++ b/mysql-test/suite/rpl/t/rpl_row_create_table.test @@ -234,3 +234,30 @@ SELECT * FROM t2 ORDER BY a; connection master; DROP TABLE t1,t2; sync_slave_with_master; + +# +# bug#35762 Failing CREATE-SELECT produces bad binlog in row mode +# + +connection master; + +CREATE TABLE t1 (a INT); + +INSERT INTO t1 VALUES (1),(1); +--error ER_DUP_ENTRY +CREATE TABLE t2 (a INT UNIQUE) ENGINE=INNODB SELECT * FROM t1; +INSERT INTO t1 VALUES (2); + +sync_slave_with_master; +# connection slave; + +--echo *** the proof of the fix: +--echo select must show that the last insert performed on the slave *** +SELECT * FROM t1; + +connection master; +DROP TABLE t1; +sync_slave_with_master; + + +--echo end of the tests diff --git a/mysql-test/t/query_cache_debug.test b/mysql-test/t/query_cache_debug.test index b741eea0b29..18dfe487ac3 100644 --- a/mysql-test/t/query_cache_debug.test +++ b/mysql-test/t/query_cache_debug.test @@ -7,7 +7,7 @@ # flush status; set query_cache_type=DEMAND; -set global query_cache_size= 1024*1024*512; +set global query_cache_size= 1024*768; --disable_warnings drop table if exists t1; --enable_warnings diff --git a/mysql-test/t/read_only_innodb.test b/mysql-test/t/read_only_innodb.test index 76d9748aa60..f8c25fdee1d 100644 --- a/mysql-test/t/read_only_innodb.test +++ b/mysql-test/t/read_only_innodb.test @@ -41,3 +41,45 @@ set global read_only=0; drop table table_11733 ; drop user test@localhost; +disconnect con1; + +# +# Bug #35732: read-only blocks SELECT statements in InnoDB +# +# Test 1: read only mode +GRANT CREATE, SELECT, DROP ON *.* TO test@localhost; +connect(con1, localhost, test, , test); + +connection default; +CREATE TABLE t1(a INT) ENGINE=INNODB; +INSERT INTO t1 VALUES (0), (1); +SET GLOBAL read_only=1; + +connection con1; +SELECT * FROM t1; +BEGIN; +SELECT * FROM t1; +COMMIT; + +connection default; +SET GLOBAL read_only=0; + +# +# Test 2: global read lock +# +FLUSH TABLES WITH READ LOCK; + +connection con1; +SELECT * FROM t1; +BEGIN; +SELECT * FROM t1; +COMMIT; + +connection default; +UNLOCK TABLES; +DROP TABLE t1; +DROP USER test@localhost; + +disconnect con1; + +--echo echo End of 5.1 tests diff --git a/scripts/mysql_system_tables_fix.sql b/scripts/mysql_system_tables_fix.sql index e2bdd668c0f..a33c4fcb9fa 100644 --- a/scripts/mysql_system_tables_fix.sql +++ b/scripts/mysql_system_tables_fix.sql @@ -433,7 +433,10 @@ ALTER TABLE db MODIFY Event_priv enum('N','Y') character set utf8 DEFAULT 'N' NO # ALTER TABLE event DROP PRIMARY KEY; ALTER TABLE event ADD PRIMARY KEY(db, name); -ALTER TABLE event ADD sql_mode +# Add sql_mode column just in case. +ALTER TABLE event ADD sql_mode set ('NOT_USED') AFTER on_completion; +# Update list of sql_mode values. +ALTER TABLE event MODIFY sql_mode set('REAL_AS_FLOAT', 'PIPES_AS_CONCAT', 'ANSI_QUOTES', diff --git a/sql/Makefile.am b/sql/Makefile.am index 3a6f4bcb7a2..33664b77957 100644 --- a/sql/Makefile.am +++ b/sql/Makefile.am @@ -54,7 +54,7 @@ noinst_HEADERS = item.h item_func.h item_sum.h item_cmpfunc.h \ procedure.h sql_class.h sql_lex.h sql_list.h \ sql_map.h sql_string.h unireg.h \ sql_error.h field.h handler.h mysqld_suffix.h \ - sql_profile.h \ + sql_profile.h \ ha_ndbcluster.h ha_ndbcluster_cond.h \ ha_ndbcluster_binlog.h ha_ndbcluster_tables.h \ ha_partition.h rpl_constants.h \ @@ -178,6 +178,12 @@ lex_hash.h: gen_lex_hash.cc lex.h udf_example_la_SOURCES= udf_example.c udf_example_la_LDFLAGS= -module -rpath $(pkglibdir) +# We might have some stuff not built in this build, but that we want to install +install-exec-hook: + $(mkinstalldirs) $(DESTDIR)$(libexecdir) $(DESTDIR)$(pkglibdir) + test ! -x mysqld-debug$(EXEEXT) || $(INSTALL_PROGRAM) mysqld-debug$(EXEEXT) $(DESTDIR)$(libexecdir) + test ! -f mysqld-debug.sym.gz || $(INSTALL_DATA) mysqld-debug.sym.gz $(DESTDIR)$(pkglibdir) + test ! -f mysqld.sym.gz || $(INSTALL_DATA) mysqld.sym.gz $(DESTDIR)$(pkglibdir) # Don't update the files from bitkeeper %::SCCS/s.% diff --git a/sql/handler.cc b/sql/handler.cc index b334e003851..6099faa929f 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -952,16 +952,21 @@ int ha_prepare(THD *thd) A helper function to evaluate if two-phase commit is mandatory. As a side effect, propagates the read-only/read-write flags of the statement transaction to its enclosing normal transaction. + + If we have at least two engines with read-write changes we must + run a two-phase commit. Otherwise we can run several independent + commits as the only transactional engine has read-write changes + and others are read-only. - @retval TRUE we must run a two-phase commit. Returned - if we have at least two engines with read-write changes. - @retval FALSE Don't need two-phase commit. Even if we have two - transactional engines, we can run two independent - commits if changes in one of the engines are read-only. + @retval 0 All engines are read-only. + @retval 1 We have the only engine with read-write changes. + @retval >1 More than one engine have read-write changes. + Note: return value might NOT be the exact number of + engines with read-write changes. */ static -bool +uint ha_check_and_coalesce_trx_read_only(THD *thd, Ha_trx_info *ha_list, bool all) { @@ -998,7 +1003,7 @@ ha_check_and_coalesce_trx_read_only(THD *thd, Ha_trx_info *ha_list, break; } } - return rw_ha_count > 1; + return rw_ha_count; } @@ -1061,25 +1066,8 @@ int ha_commit_trans(THD *thd, bool all) #ifdef USING_TRANSACTIONS if (ha_info) { - bool must_2pc; - - if (is_real_trans && wait_if_global_read_lock(thd, 0, 0)) - { - ha_rollback_trans(thd, all); - DBUG_RETURN(1); - } - - if ( is_real_trans - && opt_readonly - && ! (thd->security_ctx->master_access & SUPER_ACL) - && ! thd->slave_thread - ) - { - my_error(ER_OPTION_PREVENTS_STATEMENT, MYF(0), "--read-only"); - ha_rollback_trans(thd, all); - error= 1; - goto end; - } + uint rw_ha_count; + bool rw_trans; DBUG_EXECUTE_IF("crash_commit_before", abort();); @@ -1087,9 +1075,29 @@ int ha_commit_trans(THD *thd, bool all) if (is_real_trans) /* not a statement commit */ thd->stmt_map.close_transient_cursors(); - must_2pc= ha_check_and_coalesce_trx_read_only(thd, ha_info, all); + rw_ha_count= ha_check_and_coalesce_trx_read_only(thd, ha_info, all); + /* rw_trans is TRUE when we in a transaction changing data */ + rw_trans= is_real_trans && (rw_ha_count > 0); - if (!trans->no_2pc && must_2pc) + if (rw_trans && + wait_if_global_read_lock(thd, 0, 0)) + { + ha_rollback_trans(thd, all); + DBUG_RETURN(1); + } + + if (rw_trans && + opt_readonly && + !(thd->security_ctx->master_access & SUPER_ACL) && + !thd->slave_thread) + { + my_error(ER_OPTION_PREVENTS_STATEMENT, MYF(0), "--read-only"); + ha_rollback_trans(thd, all); + error= 1; + goto end; + } + + if (!trans->no_2pc && (rw_ha_count > 1)) { for (; ha_info && !error; ha_info= ha_info->next()) { @@ -1129,7 +1137,7 @@ int ha_commit_trans(THD *thd, bool all) tc_log->unlog(cookie, xid); DBUG_EXECUTE_IF("crash_commit_after", abort();); end: - if (is_real_trans) + if (rw_trans) start_waiting_global_read_lock(thd); } #endif /* USING_TRANSACTIONS */ diff --git a/sql/lock.cc b/sql/lock.cc index a0d6faa6604..675b94c2175 100644 --- a/sql/lock.cc +++ b/sql/lock.cc @@ -1533,6 +1533,7 @@ void start_waiting_global_read_lock(THD *thd) if (unlikely(thd->global_read_lock)) DBUG_VOID_RETURN; (void) pthread_mutex_lock(&LOCK_global_read_lock); + DBUG_ASSERT(protect_against_global_read_lock); tmp= (!--protect_against_global_read_lock && (waiting_for_read_lock || global_read_lock_blocks_commit)); (void) pthread_mutex_unlock(&LOCK_global_read_lock); diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 8bafb15eeaa..f619899f3b1 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -1948,6 +1948,7 @@ extern "C" sig_handler abort_thread(int sig __attribute__((unused))) static BOOL WINAPI console_event_handler( DWORD type ) { DBUG_ENTER("console_event_handler"); +#ifndef EMBEDDED_LIBRARY if(type == CTRL_C_EVENT) { /* @@ -1962,6 +1963,7 @@ static BOOL WINAPI console_event_handler( DWORD type ) sql_print_warning("CTRL-C ignored during startup"); DBUG_RETURN(TRUE); } +#endif DBUG_RETURN(FALSE); } diff --git a/sql/set_var.cc b/sql/set_var.cc index 99931d7bafc..b4b81ba2fbe 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -713,7 +713,7 @@ static uchar *slave_get_report_port(THD *thd) return (uchar*) &thd->sys_var_tmp.long_value; } -static sys_var_readonly sys_repl_report_port(&vars, "report_port", OPT_GLOBAL, SHOW_INT, slave_get_report_port); +static sys_var_readonly sys_repl_report_port(&vars, "report_port", OPT_GLOBAL, SHOW_LONG, slave_get_report_port); #endif diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index 89038bacda3..d1e5c26912d 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -3720,7 +3720,7 @@ void select_create::abort() select_insert::abort(); thd->transaction.stmt.modified_non_trans_table= FALSE; reenable_binlog(thd); - + thd->binlog_flush_pending_rows_event(TRUE); if (m_plock) { diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh index 9a417d5f02d..5cbd85c62b4 100644 --- a/support-files/mysql.spec.sh +++ b/support-files/mysql.spec.sh @@ -27,6 +27,16 @@ %{?_with_yassl:%define YASSL_BUILD 1} %{!?_with_yassl:%define YASSL_BUILD 0} +# use "rpmbuild --with cluster" or "rpm --define '_with_cluster 1'" (for RPM 3.x) +# to build with cluster support (off by default) +%{?_with_cluster:%define CLUSTER_BUILD 1} +%{!?_with_cluster:%define CLUSTER_BUILD 0} + +# use "rpmbuild --with federated" or "rpm --define '_with_federated 1'" (for RPM 3.x) +# to build with federated support (off by default) +%{?_with_federated:%define FEDERATED_BUILD 1} +%{!?_with_federated:%define FEDERATED_BUILD 0} + %if %{STATIC_BUILD} %define release 0 %else @@ -134,6 +144,7 @@ This package contains the standard MySQL clients and administration tools. %{see_base} +%if %{CLUSTER_BUILD} %package ndb-storage Summary: MySQL - ndbcluster storage engine Group: Applications/Databases @@ -174,6 +185,7 @@ This package contains some extra ndbcluster storage engine tools for the advance They should be used with caution. %{see_base} +%endif %package test Requires: %{name}-client perl-DBI perl @@ -322,12 +334,19 @@ CXXFLAGS=`echo "${MYSQL_BUILD_CXXFLAGS:-$RPM_OPT_FLAGS -felide-constructors -fno BuildMySQL "--enable-shared \ --with-debug \ --with-innodb \ +%if %{CLUSTER_BUILD} --with-ndbcluster \ +%else + --without-ndbcluster \ +%endif --with-archive-storage-engine \ --with-csv-storage-engine \ - --with-example-storage-engine \ --with-blackhole-storage-engine \ +%if %{FEDERATED_BUILD} --with-federated-storage-engine \ +%else + --without-federated-storage-engine \ +%endif --with-partition \ --with-big-tables \ --with-comment=\"MySQL Community Server - Debug (GPL)\"") @@ -351,12 +370,19 @@ CFLAGS="${MYSQL_BUILD_CFLAGS:-$RPM_OPT_FLAGS} -g" \ CXXFLAGS="${MYSQL_BUILD_CXXFLAGS:-$RPM_OPT_FLAGS -felide-constructors -fno-exceptions -fno-rtti} -g" \ BuildMySQL "--enable-shared \ --with-innodb \ +%if %{CLUSTER_BUILD} --with-ndbcluster \ +%else + --without-ndbcluster \ +%endif --with-archive-storage-engine \ --with-csv-storage-engine \ - --with-example-storage-engine \ --with-blackhole-storage-engine \ +%if %{FEDERATED_BUILD} --with-federated-storage-engine \ +%else + --without-federated-storage-engine \ +%endif --with-partition \ --with-embedded-server \ --with-big-tables \ @@ -563,12 +589,13 @@ sleep 2 #scheduled service packs and more. Visit www.mysql.com/enterprise for more #information." +%if %{CLUSTER_BUILD} %post ndb-storage mysql_clusterdir=/var/lib/mysql-cluster # Create cluster directory if needed if test ! -d $mysql_clusterdir; then mkdir -m 755 $mysql_clusterdir; fi - +%endif %preun server if test $1 = 0 @@ -603,7 +630,9 @@ fi %doc mysql-release-%{mysql_version}/COPYING mysql-release-%{mysql_version}/README %doc mysql-release-%{mysql_version}/support-files/my-*.cnf +%if %{CLUSTER_BUILD} %doc mysql-release-%{mysql_version}/support-files/ndb-*.ini +%endif %doc %attr(644, root, root) %{_infodir}/mysql.info* @@ -698,6 +727,7 @@ fi %postun shared /sbin/ldconfig +%if %{CLUSTER_BUILD} %files ndb-storage %defattr(-,root,root,0755) %attr(755, root, root) %{_sbindir}/ndbd @@ -745,6 +775,7 @@ fi %doc %attr(644, root, man) %{_mandir}/man1/ndb_delete_all.1* %doc %attr(644, root, man) %{_mandir}/man1/ndb_drop_index.1* %doc %attr(644, root, man) %{_mandir}/man1/ndb_drop_table.1* +%endif %files devel %defattr(-, root, root, 0755) @@ -767,8 +798,10 @@ fi %{_libdir}/mysql/libmysqlclient_r.la %{_libdir}/mysql/libmystrings.a %{_libdir}/mysql/libmysys.a +%if %{CLUSTER_BUILD} %{_libdir}/mysql/libndbclient.a %{_libdir}/mysql/libndbclient.la +%endif %{_libdir}/mysql/libvio.a %{_libdir}/mysql/libz.a %{_libdir}/mysql/libz.la @@ -777,7 +810,9 @@ fi %defattr(-, root, root, 0755) # Shared libraries (omit for architectures that don't support them) %{_libdir}/libmysql*.so* +%if %{CLUSTER_BUILD} %{_libdir}/libndb*.so* +%endif %files test %defattr(-, root, root, 0755) @@ -799,6 +834,11 @@ fi # itself - note that they must be ordered by date (important when # merging BK trees) %changelog +* Mon Mar 31 2008 Kent Boortz + +- Made the "Federated" storage engine an option +- Made the "Cluster" storage engine and sub packages an option + * Wed Mar 19 2008 Joerg Bruehe - Add the man pages for "ndbd" and "ndb_mgmd".