Skip to content

Commit c51f85f

Browse files
committed
Merge branch '10.2' into 10.3
2 parents a89f199 + 8ce702a commit c51f85f

File tree

255 files changed

+3975
-1186
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

255 files changed

+3975
-1186
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@ ADD_CUSTOM_TARGET(INFO_BIN ALL
491491
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
492492
)
493493

494-
INSTALL_DOCUMENTATION(README.md CREDITS COPYING COPYING.thirdparty
494+
INSTALL_DOCUMENTATION(README.md CREDITS COPYING THIRDPARTY
495495
EXCEPTIONS-CLIENT COMPONENT Readme)
496496

497497
# MDEV-6526 these files are not installed anymore

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ https://launchpad.net/~maria-discuss
4545
and the #maria IRC channel on Freenode.
4646

4747

48-
License:
49-
--------
48+
Licensing:
49+
----------
5050

5151
***************************************************************************
5252

@@ -57,8 +57,8 @@ General Public License (GPLv2). (I.e. Without the "any later version"
5757
clause.) This is inherited from MySQL. Please see the README file in
5858
the MySQL distribution for more information.
5959

60-
License information can be found in the COPYING, COPYING.LESSER,
61-
and COPYING.thirdparty files.
60+
License information can be found in the COPYING file. Third party
61+
license information can be found in the THIRDPARTY file.
6262

6363
***************************************************************************
6464

File renamed without changes.

client/mysql_plugin.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ static int get_default_values()
321321
int ret= 0;
322322
FILE *file= 0;
323323

324-
bzero(tool_path, FN_REFLEN);
324+
memset(tool_path, 0, FN_REFLEN);
325325
if ((error= find_tool("my_print_defaults" FN_EXEEXT, tool_path)))
326326
goto exit;
327327
else
@@ -334,9 +334,9 @@ static int get_default_values()
334334
char *format_str= 0;
335335

336336
if (has_spaces(tool_path) || has_spaces(defaults_file))
337-
format_str = "\"%s mysqld > %s\"";
337+
format_str = "\"%s --mysqld > %s\"";
338338
else
339-
format_str = "%s mysqld > %s";
339+
format_str = "%s --mysqld > %s";
340340

341341
snprintf(defaults_cmd, sizeof(defaults_cmd), format_str,
342342
add_quotes(tool_path), add_quotes(defaults_file));
@@ -347,7 +347,7 @@ static int get_default_values()
347347
}
348348
#else
349349
snprintf(defaults_cmd, sizeof(defaults_cmd),
350-
"%s mysqld > %s", tool_path, defaults_file);
350+
"%s --mysqld > %s", tool_path, defaults_file);
351351
#endif
352352

353353
/* Execute the command */

client/mysqldump.c

Lines changed: 31 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -3322,7 +3322,7 @@ static void dump_trigger_old(FILE *sql_file, MYSQL_RES *show_triggers_rs,
33223322

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

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

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

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

3488-
if (path && !(sql_file= open_sql_file_for_table(table_name,
3489-
O_WRONLY | O_APPEND)))
3490+
if (path &&
3491+
!(sql_file= open_sql_file_for_table(table_name, O_WRONLY | O_APPEND)))
34903492
DBUG_RETURN(1);
34913493

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

35033505
/* Get list of triggers. */
35043506

3505-
my_snprintf(query_buff, sizeof(query_buff),
3506-
"SELECT TRIGGER_NAME FROM INFORMATION_SCHEMA.TRIGGERS "
3507-
"WHERE EVENT_OBJECT_SCHEMA = DATABASE() AND "
3508-
"EVENT_OBJECT_TABLE = %s",
3509-
quote_for_equal(table_name, name_buff));
3507+
if (use_show_create_trigger)
3508+
my_snprintf(query_buff, sizeof(query_buff),
3509+
"SELECT TRIGGER_NAME FROM INFORMATION_SCHEMA.TRIGGERS "
3510+
"WHERE EVENT_OBJECT_SCHEMA = DATABASE() AND "
3511+
"EVENT_OBJECT_TABLE = %s",
3512+
quote_for_equal(table_name, name_buff));
3513+
else
3514+
my_snprintf(query_buff, sizeof(query_buff), "SHOW TRIGGERS LIKE %s",
3515+
quote_for_like(table_name, name_buff));
35103516

35113517
if (mysql_query_with_error_report(mysql, &show_triggers_rs, query_buff))
35123518
goto done;
@@ -3522,35 +3528,28 @@ static int dump_triggers_for_table(char *table_name, char *db_name)
35223528

35233529
while ((row= mysql_fetch_row(show_triggers_rs)))
35243530
{
3525-
3526-
my_snprintf(query_buff, sizeof (query_buff),
3527-
"SHOW CREATE TRIGGER %s",
3528-
quote_name(row[0], name_buff, TRUE));
3529-
3530-
if (mysql_query(mysql, query_buff))
3531+
if (use_show_create_trigger)
35313532
{
3532-
/*
3533-
mysqldump is being run against old server, that does not support
3534-
SHOW CREATE TRIGGER statement. We should use SHOW TRIGGERS output.
3533+
MYSQL_RES *show_create_trigger_rs;
35353534

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

3540-
dump_trigger_old(sql_file, show_triggers_rs, &row, table_name);
3541-
}
3542-
else
3543-
{
3544-
MYSQL_RES *show_create_trigger_rs= mysql_store_result(mysql);
3545-
3546-
int error= (!show_create_trigger_rs ||
3547-
dump_trigger(sql_file, show_create_trigger_rs, db_name,
3548-
db_cl_name));
3549-
mysql_free_result(show_create_trigger_rs);
3550-
if (error)
3538+
if (mysql_query_with_error_report(mysql, &show_create_trigger_rs,
3539+
query_buff))
35513540
goto done;
3541+
else
3542+
{
3543+
int error= (!show_create_trigger_rs ||
3544+
dump_trigger(sql_file, show_create_trigger_rs, db_name,
3545+
db_cl_name));
3546+
mysql_free_result(show_create_trigger_rs);
3547+
if (error)
3548+
goto done;
3549+
}
35523550
}
3553-
3551+
else
3552+
dump_trigger_old(sql_file, show_triggers_rs, &row, table_name);
35543553
}
35553554

35563555
if (opt_xml)

client/mysqlimport.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -514,11 +514,11 @@ static void safe_exit(int error, MYSQL *mysql)
514514
if (mysql)
515515
mysql_close(mysql);
516516

517+
mysql_library_end();
517518
#ifdef HAVE_SMEM
518519
my_free(shared_memory_base_name);
519520
#endif
520521
free_defaults(argv_to_free);
521-
mysql_library_end();
522522
my_free(opt_password);
523523
if (error)
524524
sf_leaking_memory= 1; /* dirty exit, some threads are still running */

include/my_tree.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ typedef struct st_tree_element {
5959
#define ELEMENT_CHILD(element, offs) (*(TREE_ELEMENT**)((char*)element + offs))
6060

6161
typedef struct st_tree {
62-
TREE_ELEMENT *root,null_element;
62+
TREE_ELEMENT *root;
6363
TREE_ELEMENT **parents[MAX_TREE_HEIGHT];
6464
uint offset_to_key,elements_in_tree,size_of_element;
6565
size_t memory_limit, allocated;

libmariadb

mysql-test/include/ctype_like_escape.inc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,9 @@ select c1 as c1u from t1 where c1 like 'ab\_def';
1616
# should return ab_def
1717
select c1 as c2h from t1 where c1 like 'ab#_def' escape '#';
1818
drop table t1;
19+
20+
#
21+
# MDEV-13335 UTF8 escape wildcard LIKE match has different behavior in different collations
22+
#
23+
SELECT @@collation_connection;
24+
SELECT '\%b' LIKE '%\%';

mysql-test/lib/generate-ssl-certs.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ openssl ca -keyfile cakey.pem -days 7300 -batch -cert cacert.pem -policy policy_
3434

3535
# with SubjectAltName, only for OpenSSL 1.0.2+
3636
cat > demoCA/sanext.conf <<EOF
37-
subjectAltName=DNS:localhost
37+
subjectAltName=IP:127.0.0.1, DNS:localhost
3838
EOF
3939
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'
4040
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

0 commit comments

Comments
 (0)