Skip to content
Permalink
Browse files
Merge branch '10.1' into 10.2
  • Loading branch information
sanja-byelkin committed May 4, 2019
2 parents 4345868 + b85aa20 commit 8cbb14e
Show file tree
Hide file tree
Showing 205 changed files with 2,788 additions and 657 deletions.
@@ -322,7 +322,7 @@ static int get_default_values()
int ret= 0;
FILE *file= 0;

bzero(tool_path, FN_REFLEN);
memset(tool_path, 0, FN_REFLEN);
if ((error= find_tool("my_print_defaults" FN_EXEEXT, tool_path)))
goto exit;
else
@@ -335,9 +335,9 @@ static int get_default_values()
char *format_str= 0;

if (has_spaces(tool_path) || has_spaces(defaults_file))
format_str = "\"%s mysqld > %s\"";
format_str = "\"%s --mysqld > %s\"";
else
format_str = "%s mysqld > %s";
format_str = "%s --mysqld > %s";

snprintf(defaults_cmd, sizeof(defaults_cmd), format_str,
add_quotes(tool_path), add_quotes(defaults_file));
@@ -348,7 +348,7 @@ static int get_default_values()
}
#else
snprintf(defaults_cmd, sizeof(defaults_cmd),
"%s mysqld > %s", tool_path, defaults_file);
"%s --mysqld > %s", tool_path, defaults_file);
#endif

/* Execute the command */
@@ -3268,7 +3268,7 @@ static void dump_trigger_old(FILE *sql_file, MYSQL_RES *show_triggers_rs,

char name_buff[NAME_LEN * 4 + 3];
const char *xml_msg= "\nWarning! mysqldump being run against old server "
"that does not\nsupport 'SHOW CREATE TRIGGERS' "
"that does not\nsupport 'SHOW CREATE TRIGGER' "
"statement. Skipping..\n";

DBUG_ENTER("dump_trigger_old");
@@ -3427,12 +3427,14 @@ static int dump_triggers_for_table(char *table_name, char *db_name)

char db_cl_name[MY_CS_NAME_SIZE];
int ret= TRUE;
/* Servers below 5.1.21 do not support SHOW CREATE TRIGGER */
const int use_show_create_trigger= mysql_get_server_version(mysql) >= 50121;

DBUG_ENTER("dump_triggers_for_table");
DBUG_PRINT("enter", ("db: %s, table_name: %s", db_name, table_name));

if (path && !(sql_file= open_sql_file_for_table(table_name,
O_WRONLY | O_APPEND)))
if (path &&
!(sql_file= open_sql_file_for_table(table_name, O_WRONLY | O_APPEND)))
DBUG_RETURN(1);

/* Do not use ANSI_QUOTES on triggers in dump */
@@ -3448,11 +3450,15 @@ static int dump_triggers_for_table(char *table_name, char *db_name)

/* Get list of triggers. */

my_snprintf(query_buff, sizeof(query_buff),
"SELECT TRIGGER_NAME FROM INFORMATION_SCHEMA.TRIGGERS "
"WHERE EVENT_OBJECT_SCHEMA = DATABASE() AND "
"EVENT_OBJECT_TABLE = %s",
quote_for_equal(table_name, name_buff));
if (use_show_create_trigger)
my_snprintf(query_buff, sizeof(query_buff),
"SELECT TRIGGER_NAME FROM INFORMATION_SCHEMA.TRIGGERS "
"WHERE EVENT_OBJECT_SCHEMA = DATABASE() AND "
"EVENT_OBJECT_TABLE = %s",
quote_for_equal(table_name, name_buff));
else
my_snprintf(query_buff, sizeof(query_buff), "SHOW TRIGGERS LIKE %s",
quote_for_like(table_name, name_buff));

if (mysql_query_with_error_report(mysql, &show_triggers_rs, query_buff))
goto done;
@@ -3468,35 +3474,28 @@ static int dump_triggers_for_table(char *table_name, char *db_name)

while ((row= mysql_fetch_row(show_triggers_rs)))
{

my_snprintf(query_buff, sizeof (query_buff),
"SHOW CREATE TRIGGER %s",
quote_name(row[0], name_buff, TRUE));

if (mysql_query(mysql, query_buff))
if (use_show_create_trigger)
{
/*
mysqldump is being run against old server, that does not support
SHOW CREATE TRIGGER statement. We should use SHOW TRIGGERS output.
MYSQL_RES *show_create_trigger_rs;

NOTE: the dump may be incorrect, as old SHOW TRIGGERS does not
provide all the necessary information to restore trigger properly.
*/
my_snprintf(query_buff, sizeof (query_buff), "SHOW CREATE TRIGGER %s",
quote_name(row[0], name_buff, TRUE));

dump_trigger_old(sql_file, show_triggers_rs, &row, table_name);
}
else
{
MYSQL_RES *show_create_trigger_rs= mysql_store_result(mysql);

int error= (!show_create_trigger_rs ||
dump_trigger(sql_file, show_create_trigger_rs, db_name,
db_cl_name));
mysql_free_result(show_create_trigger_rs);
if (error)
if (mysql_query_with_error_report(mysql, &show_create_trigger_rs,
query_buff))
goto done;
else
{
int error= (!show_create_trigger_rs ||
dump_trigger(sql_file, show_create_trigger_rs, db_name,
db_cl_name));
mysql_free_result(show_create_trigger_rs);
if (error)
goto done;
}
}

else
dump_trigger_old(sql_file, show_triggers_rs, &row, table_name);
}

if (opt_xml)
@@ -103,7 +103,8 @@ UPSTREAM="${MYSQL_VERSION_MAJOR}.${MYSQL_VERSION_MINOR}.${MYSQL_VERSION_PATCH}${
PATCHLEVEL="+maria"
LOGSTRING="MariaDB build"
CODENAME="$(lsb_release -sc)"
if [[ "$CODENAME" == bionic ]]; then
VERNUM="$(lsb_release -sr)"
if [[ "${VERNUM%.*}" -ge 18 ]]; then
EPOCH="1:"
fi

@@ -7,14 +7,13 @@

@DPATCH@

--- mysql-dfsg-5.1-5.1.23rc.orig/scripts/mysql_install_db.sh 2008-01-29 22:41:20.000000000 +0100
+++ mysql-dfsg-5.1-5.1.23rc/scripts/mysql_install_db.sh 2008-02-28 10:08:11.000000000 +0100
@@ -372,7 +372,7 @@ then
fi

# Create database directories
-for dir in "$ldata" "$ldata/mysql" "$ldata/test"
+for dir in "$ldata" "$ldata/mysql"
do
if test ! -d "$dir"
then
--- a/scripts/mysql_install_db.sh
+++ b/scripts/mysql_install_db.sh
@@ -36,7 +36,6 @@ in_rpm=0
ip_only=0
cross_bootstrap=0
install_params="create database if not exists mysql;
-create database if not exists test;
use mysql;"
auth_root_authentication_method=normal
auth_root_socket_user='root'
@@ -59,7 +59,7 @@ typedef struct st_tree_element {
#define ELEMENT_CHILD(element, offs) (*(TREE_ELEMENT**)((char*)element + offs))

typedef struct st_tree {
TREE_ELEMENT *root,null_element;
TREE_ELEMENT *root;
TREE_ELEMENT **parents[MAX_TREE_HEIGHT];
uint offset_to_key,elements_in_tree,size_of_element;
size_t memory_limit, allocated;
@@ -16,3 +16,9 @@ select c1 as c1u from t1 where c1 like 'ab\_def';
# should return ab_def
select c1 as c2h from t1 where c1 like 'ab#_def' escape '#';
drop table t1;

#
# MDEV-13335 UTF8 escape wildcard LIKE match has different behavior in different collations
#
SELECT @@collation_connection;
SELECT '\%b' LIKE '%\%';
@@ -34,7 +34,7 @@ openssl ca -keyfile cakey.pem -days 7300 -batch -cert cacert.pem -policy policy_

# with SubjectAltName, only for OpenSSL 1.0.2+
cat > demoCA/sanext.conf <<EOF
subjectAltName=DNS:localhost
subjectAltName=IP:127.0.0.1, DNS:localhost
EOF
openssl req -newkey rsa:2048 -keyout serversan-key.pem -out demoCA/serversan-req.pem -days 7300 -nodes -subj '/CN=server/C=FI/ST=Helsinki/L=Helsinki/O=MariaDB'
openssl ca -keyfile cakey.pem -extfile demoCA/sanext.conf -days 7300 -batch -cert cacert.pem -policy policy_anything -out serversan-cert.pem -in demoCA/serversan-req.pem
@@ -3201,6 +3201,10 @@ sub mysql_install_db {
mtr_appendfile_to_file("$sql_dir/mysql_system_tables.sql",
$bootstrap_sql_file);

my $gis_sp_path = $source_dist ? "$bindir/scripts" : $sql_dir;
mtr_appendfile_to_file("$gis_sp_path/maria_add_gis_sp_bootstrap.sql",
$bootstrap_sql_file);

# Add the performance tables
# for a production system
mtr_appendfile_to_file("$sql_dir/mysql_performance_tables.sql",
@@ -245,7 +245,11 @@ Log_name Pos Event_type Server_id End_log_pos Info
RESET MASTER;
SET timestamp=UNIX_TIMESTAMP('2014-11-01 10:20:30');
CREATE OR REPLACE EVENT ev1 ON SCHEDULE EVERY 1 SECOND DO DROP TABLE IF EXISTS t1;
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
CREATE OR REPLACE EVENT ev1 ON SCHEDULE EVERY 1 SECOND DO DROP TABLE IF EXISTS t2;
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
SELECT EVENT_NAME, EVENT_DEFINITION FROM INFORMATION_SCHEMA.EVENTS;
EVENT_NAME EVENT_DEFINITION
ev1 DROP TABLE IF EXISTS t2
@@ -4,6 +4,8 @@ CREATE TABLE t1 (a INT);
CREATE OR REPLACE EVENT IF NOT EXISTS ev1 ON SCHEDULE EVERY 1 SECOND DO DROP DATABASE db1;
ERROR HY000: Incorrect usage of OR REPLACE and IF NOT EXISTS
CREATE EVENT ev1 ON SCHEDULE EVERY 1 SECOND DO INSERT INTO t1 VALUES (10);
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
SELECT EVENT_NAME, EVENT_DEFINITION FROM INFORMATION_SCHEMA.EVENTS;
EVENT_NAME EVENT_DEFINITION
ev1 INSERT INTO t1 VALUES (10)
@@ -21,10 +23,13 @@ ev1 INSERT INTO t1 VALUES (10)
CREATE EVENT IF NOT EXISTS ev1 ON SCHEDULE EVERY 1 SECOND DO INSERT INTO t1 VALUES (12);
Warnings:
Note 1537 Event 'ev1' already exists
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
SELECT EVENT_NAME, EVENT_DEFINITION FROM INFORMATION_SCHEMA.EVENTS;
EVENT_NAME EVENT_DEFINITION
ev1 INSERT INTO t1 VALUES (10)
CREATE OR REPLACE EVENT ev1 ON SCHEDULE EVERY 1 SECOND DO INSERT INTO t1 VALUES (13);
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
SELECT EVENT_NAME, EVENT_DEFINITION FROM INFORMATION_SCHEMA.EVENTS;
EVENT_NAME EVENT_DEFINITION
ev1 INSERT INTO t1 VALUES (13)
@@ -220,6 +220,12 @@ select c1 as c2h from t1 where c1 like 'ab#_def' escape '#';
c2h
ab_def
drop table t1;
SELECT @@collation_connection;
@@collation_connection
big5_chinese_ci
SELECT '\%b' LIKE '%\%';
'\%b' LIKE '%\%'
0
CREATE TABLE t1 AS
SELECT 10 AS a, REPEAT('a',20) AS b, REPEAT('a',8) AS c, REPEAT('a',8) AS d;
ALTER TABLE t1 ADD PRIMARY KEY(a), ADD KEY(b);
@@ -450,6 +456,12 @@ select c1 as c2h from t1 where c1 like 'ab#_def' escape '#';
c2h
ab_def
drop table t1;
SELECT @@collation_connection;
@@collation_connection
big5_bin
SELECT '\%b' LIKE '%\%';
'\%b' LIKE '%\%'
0
CREATE TABLE t1 AS
SELECT 10 AS a, REPEAT('a',20) AS b, REPEAT('a',8) AS c, REPEAT('a',8) AS d;
ALTER TABLE t1 ADD PRIMARY KEY(a), ADD KEY(b);
@@ -220,6 +220,12 @@ select c1 as c2h from t1 where c1 like 'ab#_def' escape '#';
c2h
ab_def
drop table t1;
SELECT @@collation_connection;
@@collation_connection
euckr_korean_ci
SELECT '\%b' LIKE '%\%';
'\%b' LIKE '%\%'
0
CREATE TABLE t1 AS
SELECT 10 AS a, REPEAT('a',20) AS b, REPEAT('a',8) AS c, REPEAT('a',8) AS d;
ALTER TABLE t1 ADD PRIMARY KEY(a), ADD KEY(b);
@@ -355,6 +361,12 @@ select c1 as c2h from t1 where c1 like 'ab#_def' escape '#';
c2h
ab_def
drop table t1;
SELECT @@collation_connection;
@@collation_connection
euckr_bin
SELECT '\%b' LIKE '%\%';
'\%b' LIKE '%\%'
0
CREATE TABLE t1 AS
SELECT 10 AS a, REPEAT('a',20) AS b, REPEAT('a',8) AS c, REPEAT('a',8) AS d;
ALTER TABLE t1 ADD PRIMARY KEY(a), ADD KEY(b);
@@ -220,6 +220,12 @@ select c1 as c2h from t1 where c1 like 'ab#_def' escape '#';
c2h
ab_def
drop table t1;
SELECT @@collation_connection;
@@collation_connection
gb2312_chinese_ci
SELECT '\%b' LIKE '%\%';
'\%b' LIKE '%\%'
0
CREATE TABLE t1 AS
SELECT 10 AS a, REPEAT('a',20) AS b, REPEAT('a',8) AS c, REPEAT('a',8) AS d;
ALTER TABLE t1 ADD PRIMARY KEY(a), ADD KEY(b);
@@ -436,6 +442,12 @@ select c1 as c2h from t1 where c1 like 'ab#_def' escape '#';
c2h
ab_def
drop table t1;
SELECT @@collation_connection;
@@collation_connection
gb2312_bin
SELECT '\%b' LIKE '%\%';
'\%b' LIKE '%\%'
0
CREATE TABLE t1 AS
SELECT 10 AS a, REPEAT('a',20) AS b, REPEAT('a',8) AS c, REPEAT('a',8) AS d;
ALTER TABLE t1 ADD PRIMARY KEY(a), ADD KEY(b);
@@ -220,6 +220,12 @@ select c1 as c2h from t1 where c1 like 'ab#_def' escape '#';
c2h
ab_def
drop table t1;
SELECT @@collation_connection;
@@collation_connection
gbk_chinese_ci
SELECT '\%b' LIKE '%\%';
'\%b' LIKE '%\%'
0
CREATE TABLE t1 AS
SELECT 10 AS a, REPEAT('a',20) AS b, REPEAT('a',8) AS c, REPEAT('a',8) AS d;
ALTER TABLE t1 ADD PRIMARY KEY(a), ADD KEY(b);
@@ -436,6 +442,12 @@ select c1 as c2h from t1 where c1 like 'ab#_def' escape '#';
c2h
ab_def
drop table t1;
SELECT @@collation_connection;
@@collation_connection
gbk_bin
SELECT '\%b' LIKE '%\%';
'\%b' LIKE '%\%'
0
CREATE TABLE t1 AS
SELECT 10 AS a, REPEAT('a',20) AS b, REPEAT('a',8) AS c, REPEAT('a',8) AS d;
ALTER TABLE t1 ADD PRIMARY KEY(a), ADD KEY(b);
@@ -506,6 +506,12 @@ select c1 as c2h from t1 where c1 like 'ab#_def' escape '#';
c2h
ab_def
drop table t1;
SELECT @@collation_connection;
@@collation_connection
latin1_swedish_ci
SELECT '\%b' LIKE '%\%';
'\%b' LIKE '%\%'
0
#
# MDEV-4842 STR_TO_DATE does not work with UCS2/UTF16/UTF32
#
@@ -636,6 +642,12 @@ select c1 as c2h from t1 where c1 like 'ab#_def' escape '#';
c2h
ab_def
drop table t1;
SELECT @@collation_connection;
@@collation_connection
latin1_bin
SELECT '\%b' LIKE '%\%';
'\%b' LIKE '%\%'
0
SELECT strcmp('a','a '), strcmp('a ','a');
strcmp('a','a ') strcmp('a ','a')
0 0
@@ -189,6 +189,12 @@ select c1 as c2h from t1 where c1 like 'ab#_def' escape '#';
c2h
ab_def
drop table t1;
SELECT @@collation_connection;
@@collation_connection
sjis_japanese_ci
SELECT '\%b' LIKE '%\%';
'�_%b' LIKE '%�_%'
0
CREATE TABLE t1 AS
SELECT 10 AS a, REPEAT('a',20) AS b, REPEAT('a',8) AS c, REPEAT('a',8) AS d;
ALTER TABLE t1 ADD PRIMARY KEY(a), ADD KEY(b);
@@ -343,6 +349,12 @@ select c1 as c2h from t1 where c1 like 'ab#_def' escape '#';
c2h
ab_def
drop table t1;
SELECT @@collation_connection;
@@collation_connection
sjis_bin
SELECT '\%b' LIKE '%\%';
'�_%b' LIKE '%�_%'
0
CREATE TABLE t1 AS
SELECT 10 AS a, REPEAT('a',20) AS b, REPEAT('a',8) AS c, REPEAT('a',8) AS d;
ALTER TABLE t1 ADD PRIMARY KEY(a), ADD KEY(b);

0 comments on commit 8cbb14e

Please sign in to comment.