Skip to content

Commit 4e70648

Browse files
committed
1 parent 1fc87de commit 4e70648

File tree

3 files changed

+10
-18
lines changed

3 files changed

+10
-18
lines changed

client/mysqldump.c

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2745,13 +2745,9 @@ static inline my_bool general_log_or_slow_log_tables(const char *db,
27452745
ARGS
27462746
seq - sequence name
27472747
db - db name
2748-
2749-
RETURN
2750-
0 if ok, 1 if error
2751-
27522748
*/
27532749

2754-
static uint get_sequence_structure(const char *seq, const char *db)
2750+
static void get_sequence_structure(const char *seq, const char *db)
27552751
{
27562752

27572753
char table_buff[NAME_LEN*2+3];
@@ -2763,23 +2759,21 @@ static uint get_sequence_structure(const char *seq, const char *db)
27632759
DBUG_ENTER("get_sequence_structure");
27642760
DBUG_PRINT("enter", ("db: %s sequence: %s", db, seq));
27652761

2766-
verbose_msg("-- Retrieving table structure for sequence %s...\n", seq);
2762+
verbose_msg("-- Retrieving sequence structure for %s...\n", seq);
27672763

27682764
result_seq= quote_name(seq, table_buff, 1);
27692765
// Sequences as tables share same flags
27702766
if (!opt_no_create_info)
27712767
{
27722768
char buff[20+FN_REFLEN];
27732769
my_snprintf(buff, sizeof(buff), "SHOW CREATE SEQUENCE %s", result_seq);
2774-
if (switch_character_set_results(mysql, "binary") ||
2775-
mysql_query_with_error_report(mysql, &result, buff) ||
2776-
switch_character_set_results(mysql, default_charset))
2770+
if (mysql_query_with_error_report(mysql, &result, buff))
27772771
{
2778-
DBUG_RETURN(1);
2772+
DBUG_VOID_RETURN;
27792773
}
27802774

27812775
print_comment(sql_file, 0,
2782-
"\n--\n-- Table structure for sequence %s\n--\n\n",
2776+
"\n--\n-- Sequence structure for %s\n--\n\n",
27832777
fix_for_comment(result_seq));
27842778
if (opt_drop)
27852779
{
@@ -2793,7 +2787,7 @@ static uint get_sequence_structure(const char *seq, const char *db)
27932787
// Sequences will not use inserts, so no need for REPLACE and LOCKS
27942788
mysql_free_result(result);
27952789
}
2796-
DBUG_RETURN(0);
2790+
DBUG_VOID_RETURN;
27972791
}
27982792
/*
27992793
get_table_structure -- retrievs database structure, prints out corresponding
@@ -3781,10 +3775,8 @@ static void dump_table(char *table, char *db, const uchar *hash_key, size_t len)
37813775
*/
37823776
if (check_if_ignore_table(table, table_type) & IGNORE_SEQUENCE_TABLE)
37833777
{
3784-
if (!get_sequence_structure(table, db))
3785-
{
3786-
DBUG_VOID_RETURN;
3787-
}
3778+
get_sequence_structure(table, db);
3779+
DBUG_VOID_RETURN;
37883780
}
37893781
/*
37903782
Make sure you get the create table info before the following check for

mysql-test/main/mysqldump.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5906,7 +5906,7 @@ ds=~!@ \# $% ^ & * ( ) _ - = + int(11) YES 5 INVISIBLE
59065906
drop database d;
59075907
#
59085908
# MDEV-21786:
5909-
# myslqdump will forget sequence definition details on --no-data dump
5909+
# mysqldump will forget sequence definition details on --no-data dump
59105910
#
59115911
create database d;
59125912
CREATE SEQUENCE d.s1 START WITH 100 INCREMENT BY 10 MINVALUE=100 MAXVALUE=1100 CYCLE;

mysql-test/main/mysqldump.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2795,7 +2795,7 @@ drop database d;
27952795

27962796
--echo #
27972797
--echo # MDEV-21786:
2798-
--echo # myslqdump will forget sequence definition details on --no-data dump
2798+
--echo # mysqldump will forget sequence definition details on --no-data dump
27992799
--echo #
28002800
create database d;
28012801

0 commit comments

Comments
 (0)