Skip to content

Commit

Permalink
Merge 10.0 -> 10.1
Browse files Browse the repository at this point in the history
  • Loading branch information
spetrunia committed May 8, 2014
2 parents b186575 + 4a84ee1 commit 0eb84da
Show file tree
Hide file tree
Showing 257 changed files with 13,876 additions and 2,616 deletions.
1 change: 0 additions & 1 deletion client/mysql.cc
Original file line number Diff line number Diff line change
Expand Up @@ -606,7 +606,6 @@ static COMMANDS commands[] = {
{ "OLD_PASSWORD", 0, 0, 0, ""},
{ "ON", 0, 0, 0, ""},
{ "ONE", 0, 0, 0, ""},
{ "ONE_SHOT", 0, 0, 0, ""},
{ "OPEN", 0, 0, 0, ""},
{ "OPTIMIZE", 0, 0, 0, ""},
{ "OPTION", 0, 0, 0, ""},
Expand Down
63 changes: 63 additions & 0 deletions client/mysqldump.c
Original file line number Diff line number Diff line change
Expand Up @@ -4406,6 +4406,12 @@ static int dump_all_tables_in_db(char *database)
else
verbose_msg("-- dump_all_tables_in_db : logs flushed successfully!\n");
}
if (opt_single_transaction && mysql_get_server_version(mysql) >= 50500)
{
verbose_msg("-- Setting savepoint...\n");
if (mysql_query_with_error_report(mysql, 0, "SAVEPOINT sp"))
DBUG_RETURN(1);
}
while ((table= getTableName(0)))
{
char *end= strmov(afterdot, table);
Expand All @@ -4423,6 +4429,23 @@ static int dump_all_tables_in_db(char *database)
maybe_exit(EX_MYSQLERR);
}
}

/**
ROLLBACK TO SAVEPOINT in --single-transaction mode to release metadata
lock on table which was already dumped. This allows to avoid blocking
concurrent DDL on this table without sacrificing correctness, as we
won't access table second time and dumps created by --single-transaction
mode have validity point at the start of transaction anyway.
Note that this doesn't make --single-transaction mode with concurrent
DDL safe in general case. It just improves situation for people for whom
it might be working.
*/
if (opt_single_transaction && mysql_get_server_version(mysql) >= 50500)
{
verbose_msg("-- Rolling back to savepoint sp...\n");
if (mysql_query_with_error_report(mysql, 0, "ROLLBACK TO SAVEPOINT sp"))
maybe_exit(EX_MYSQLERR);
}
}
else
{
Expand All @@ -4445,6 +4468,14 @@ static int dump_all_tables_in_db(char *database)
}
}
}

if (opt_single_transaction && mysql_get_server_version(mysql) >= 50500)
{
verbose_msg("-- Releasing savepoint...\n");
if (mysql_query_with_error_report(mysql, 0, "RELEASE SAVEPOINT sp"))
DBUG_RETURN(1);
}

if (opt_events && mysql_get_server_version(mysql) >= 50106)
{
DBUG_PRINT("info", ("Dumping events for database %s", database));
Expand Down Expand Up @@ -4687,6 +4718,13 @@ static int dump_selected_tables(char *db, char **table_names, int tables)
if (opt_xml)
print_xml_tag(md_result_file, "", "\n", "database", "name=", db, NullS);

if (opt_single_transaction && mysql_get_server_version(mysql) >= 50500)
{
verbose_msg("-- Setting savepoint...\n");
if (mysql_query_with_error_report(mysql, 0, "SAVEPOINT sp"))
DBUG_RETURN(1);
}

/* Dump each selected table */
for (pos= dump_tables; pos < end; pos++)
{
Expand All @@ -4702,6 +4740,31 @@ static int dump_selected_tables(char *db, char **table_names, int tables)
maybe_exit(EX_MYSQLERR);
}
}

/**
ROLLBACK TO SAVEPOINT in --single-transaction mode to release metadata
lock on table which was already dumped. This allows to avoid blocking
concurrent DDL on this table without sacrificing correctness, as we
won't access table second time and dumps created by --single-transaction
mode have validity point at the start of transaction anyway.
Note that this doesn't make --single-transaction mode with concurrent
DDL safe in general case. It just improves situation for people for whom
it might be working.
*/
if (opt_single_transaction && mysql_get_server_version(mysql) >= 50500)
{
verbose_msg("-- Rolling back to savepoint sp...\n");
if (mysql_query_with_error_report(mysql, 0, "ROLLBACK TO SAVEPOINT sp"))
maybe_exit(EX_MYSQLERR);
}
}

if (opt_single_transaction && mysql_get_server_version(mysql) >= 50500)
{
verbose_msg("-- Releasing savepoint...\n");
if (mysql_query_with_error_report(mysql, 0, "RELEASE SAVEPOINT sp"))
DBUG_RETURN(1);

}

/* Dump each selected view */
Expand Down
3 changes: 2 additions & 1 deletion debian/dist/Debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,8 @@ Description: MariaDB database regression test suite (metapackage depending on th
Package: mariadb-connect-engine-10.0
Section: database
Architecture: any
Depends: mariadb-server-10.0, unixODBC-dev, libxml2-dev
Depends: mariadb-server-10.0, unixODBC, libxml2
Build-depends: mariadb-server-10.0, unixODBC-dev, libxml2-dev
Description: Connect storage engine for MariaDB
Connect engine supports a number of file formats (dbf, xml, txt, bin, etc),
connections to ODBC tables and remote MySQL tables, as well as a number of
Expand Down
3 changes: 2 additions & 1 deletion debian/dist/Ubuntu/control
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,8 @@ Description: MariaDB database regression test suite (metapackage depending on th
Package: mariadb-connect-engine-10.0
Section: database
Architecture: any
Depends: mariadb-server-10.0, unixODBC-dev, libxml2-dev
Depends: mariadb-server-10.0, unixODBC, libxml2
Build-depends: mariadb-server-10.0, unixODBC-dev, libxml2-dev
Description: Connect storage engine for MariaDB
Connect engine supports a number of file formats (dbf, xml, txt, bin, etc),
connections to ODBC tables and remote MySQL tables, as well as a number of
Expand Down
22 changes: 22 additions & 0 deletions mysql-test/include/ctype_filesort.inc
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,25 @@ INSERT INTO t1 VALUES (1),(2);
SELECT * FROM t1 GROUP BY MID(CURRENT_USER,0) WITH ROLLUP;
SELECT * FROM t1 GROUP BY MID('test',0) WITH ROLLUP;
DROP TABLE t1;

--echo #
--echo # MDEV-6170 Incorrect ordering with utf8_bin and utf8mb4_bin collations
--echo #
SELECT @@collation_connection;
CREATE TABLE t1 ENGINE=MEMORY AS SELECT REPEAT('a',5) AS a LIMIT 0;
INSERT INTO t1 (a) VALUES ("a");
INSERT INTO t1 (a) VALUES ("b");
INSERT INTO t1 (a) VALUES ("c");
INSERT INTO t1 (a) VALUES ("d");
INSERT INTO t1 (a) VALUES ("e");
INSERT INTO t1 (a) VALUES ("f");
INSERT INTO t1 (a) VALUES ("g");
INSERT INTO t1 (a) VALUES ("h");
INSERT INTO t1 (a) VALUES ("i");
INSERT INTO t1 (a) VALUES ("j");
INSERT INTO t1 (a) VALUES ("k");
INSERT INTO t1 (a) VALUES ("l");
INSERT INTO t1 (a) VALUES ("m");
SELECT * FROM t1 ORDER BY LOWER(a);
SELECT * FROM t1 ORDER BY LOWER(a) DESC;
DROP TABLE t1;
102 changes: 102 additions & 0 deletions mysql-test/r/ctype_big5.result
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,57 @@ i
1
1
DROP TABLE t1;
#
# MDEV-6170 Incorrect ordering with utf8_bin and utf8mb4_bin collations
#
SELECT @@collation_connection;
@@collation_connection
big5_chinese_ci
CREATE TABLE t1 ENGINE=MEMORY AS SELECT REPEAT('a',5) AS a LIMIT 0;
INSERT INTO t1 (a) VALUES ("a");
INSERT INTO t1 (a) VALUES ("b");
INSERT INTO t1 (a) VALUES ("c");
INSERT INTO t1 (a) VALUES ("d");
INSERT INTO t1 (a) VALUES ("e");
INSERT INTO t1 (a) VALUES ("f");
INSERT INTO t1 (a) VALUES ("g");
INSERT INTO t1 (a) VALUES ("h");
INSERT INTO t1 (a) VALUES ("i");
INSERT INTO t1 (a) VALUES ("j");
INSERT INTO t1 (a) VALUES ("k");
INSERT INTO t1 (a) VALUES ("l");
INSERT INTO t1 (a) VALUES ("m");
SELECT * FROM t1 ORDER BY LOWER(a);
a
a
b
c
d
e
f
g
h
i
j
k
l
m
SELECT * FROM t1 ORDER BY LOWER(a) DESC;
a
m
l
k
j
i
h
g
f
e
d
c
b
a
DROP TABLE t1;
create table t1 engine=innodb select repeat('a',50) as c1;
alter table t1 add index(c1(5));
insert into t1 values ('abcdefg'),('abcde100'),('abcde110'),('abcde111');
Expand Down Expand Up @@ -284,6 +335,57 @@ i
1
1
DROP TABLE t1;
#
# MDEV-6170 Incorrect ordering with utf8_bin and utf8mb4_bin collations
#
SELECT @@collation_connection;
@@collation_connection
big5_bin
CREATE TABLE t1 ENGINE=MEMORY AS SELECT REPEAT('a',5) AS a LIMIT 0;
INSERT INTO t1 (a) VALUES ("a");
INSERT INTO t1 (a) VALUES ("b");
INSERT INTO t1 (a) VALUES ("c");
INSERT INTO t1 (a) VALUES ("d");
INSERT INTO t1 (a) VALUES ("e");
INSERT INTO t1 (a) VALUES ("f");
INSERT INTO t1 (a) VALUES ("g");
INSERT INTO t1 (a) VALUES ("h");
INSERT INTO t1 (a) VALUES ("i");
INSERT INTO t1 (a) VALUES ("j");
INSERT INTO t1 (a) VALUES ("k");
INSERT INTO t1 (a) VALUES ("l");
INSERT INTO t1 (a) VALUES ("m");
SELECT * FROM t1 ORDER BY LOWER(a);
a
a
b
c
d
e
f
g
h
i
j
k
l
m
SELECT * FROM t1 ORDER BY LOWER(a) DESC;
a
m
l
k
j
i
h
g
f
e
d
c
b
a
DROP TABLE t1;
create table t1 engine=innodb select repeat('a',50) as c1;
alter table t1 add index(c1(5));
insert into t1 values ('abcdefg'),('abcde100'),('abcde110'),('abcde111');
Expand Down
51 changes: 51 additions & 0 deletions mysql-test/r/ctype_cp1250_ch.result
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,57 @@ i
1
1
DROP TABLE t1;
#
# MDEV-6170 Incorrect ordering with utf8_bin and utf8mb4_bin collations
#
SELECT @@collation_connection;
@@collation_connection
cp1250_czech_cs
CREATE TABLE t1 ENGINE=MEMORY AS SELECT REPEAT('a',5) AS a LIMIT 0;
INSERT INTO t1 (a) VALUES ("a");
INSERT INTO t1 (a) VALUES ("b");
INSERT INTO t1 (a) VALUES ("c");
INSERT INTO t1 (a) VALUES ("d");
INSERT INTO t1 (a) VALUES ("e");
INSERT INTO t1 (a) VALUES ("f");
INSERT INTO t1 (a) VALUES ("g");
INSERT INTO t1 (a) VALUES ("h");
INSERT INTO t1 (a) VALUES ("i");
INSERT INTO t1 (a) VALUES ("j");
INSERT INTO t1 (a) VALUES ("k");
INSERT INTO t1 (a) VALUES ("l");
INSERT INTO t1 (a) VALUES ("m");
SELECT * FROM t1 ORDER BY LOWER(a);
a
a
b
c
d
e
f
g
h
i
j
k
l
m
SELECT * FROM t1 ORDER BY LOWER(a) DESC;
a
m
l
k
j
i
h
g
f
e
d
c
b
a
DROP TABLE t1;
set global LC_MESSAGES=convert((@@global.log_bin_trust_function_creators)
using cp1250);
ERROR HY000: Unknown locale: '1'
Expand Down
Loading

0 comments on commit 0eb84da

Please sign in to comment.