Skip to content

Commit 9ee09a3

Browse files
committed
Merge branch '11.7' into 11.8
2 parents c516bea + 80067a6 commit 9ee09a3

File tree

511 files changed

+13244
-7172
lines changed

Some content is hidden

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

511 files changed

+13244
-7172
lines changed

CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,9 @@ IF(UNIX)
501501
ADD_SUBDIRECTORY(man)
502502
ENDIF()
503503

504-
INCLUDE(cmake/abi_check.cmake)
504+
IF (NOT WITHOUT_ABI_CHECK)
505+
INCLUDE(cmake/abi_check.cmake)
506+
ENDIF()
505507
INCLUDE(cmake/tags.cmake)
506508
INCLUDE(for_clients)
507509
ADD_SUBDIRECTORY(scripts)

VERSION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
MYSQL_VERSION_MAJOR=11
22
MYSQL_VERSION_MINOR=8
3-
MYSQL_VERSION_PATCH=0
4-
SERVER_MATURITY=alpha
3+
MYSQL_VERSION_PATCH=1
4+
SERVER_MATURITY=gamma

client/mysqlbinlog.cc

Lines changed: 19 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,6 @@
4343
#include "sql_priv.h"
4444
#include "sql_basic_types.h"
4545
#include <atomic>
46-
#if 0 /* FIXME: the following is broken for now */
47-
# include "mariadb_rpl.h"
48-
#else
49-
enum Item_result {STRING_RESULT,REAL_RESULT,INT_RESULT,ROW_RESULT,DECIMAL_RESULT};
50-
#endif
5146
#include "log_event.h"
5247
#include "compat56.h"
5348
#include "sql_common.h"
@@ -165,7 +160,9 @@ static Server_gtid_event_filter *server_id_gtid_filter= NULL;
165160

166161
static char *start_datetime_str, *stop_datetime_str;
167162
static my_time_t start_datetime= 0, stop_datetime= 0;
163+
static my_time_t last_processed_datetime= MY_TIME_T_MAX;
168164
static bool stop_datetime_given= false;
165+
169166
static ulonglong rec_count= 0;
170167
static MYSQL* mysql = NULL;
171168
static const char* dirname_for_local_load= 0;
@@ -871,6 +868,7 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
871868
DBUG_ENTER("process_event");
872869
Exit_status retval= OK_CONTINUE;
873870
IO_CACHE *const head= &print_event_info->head_cache;
871+
my_time_t ev_when= ev->when;
874872

875873
/*
876874
We use Gtid_list_log_event information to determine if there is missing
@@ -1371,6 +1369,7 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
13711369
end:
13721370
rec_count++;
13731371
end_skip_count:
1372+
last_processed_datetime= ev_when;
13741373

13751374
DBUG_PRINT("info", ("end event processing"));
13761375
/*
@@ -2935,6 +2934,7 @@ static Exit_status check_header(IO_CACHE* file,
29352934
uchar buf[PROBE_HEADER_LEN];
29362935
my_off_t tmp_pos, pos;
29372936
MY_STAT my_file_stat;
2937+
int read_error;
29382938

29392939
delete glob_description_event;
29402940
if (!(glob_description_event= new Format_description_log_event(4)))
@@ -3017,7 +3017,8 @@ static Exit_status check_header(IO_CACHE* file,
30173017
Format_description_log_event *new_description_event;
30183018
my_b_seek(file, tmp_pos); /* seek back to event's start */
30193019
if (!(new_description_event= (Format_description_log_event*)
3020-
Log_event::read_log_event(file, glob_description_event,
3020+
Log_event::read_log_event(file, &read_error,
3021+
glob_description_event,
30213022
opt_verify_binlog_checksum)))
30223023
/* EOF can't be hit here normally, so it's a real error */
30233024
{
@@ -3050,7 +3051,8 @@ static Exit_status check_header(IO_CACHE* file,
30503051
{
30513052
Log_event *ev;
30523053
my_b_seek(file, tmp_pos); /* seek back to event's start */
3053-
if (!(ev= Log_event::read_log_event(file, glob_description_event,
3054+
if (!(ev= Log_event::read_log_event(file, &read_error,
3055+
glob_description_event,
30543056
opt_verify_binlog_checksum)))
30553057
{
30563058
/* EOF can't be hit here normally, so it's a real error */
@@ -3090,7 +3092,6 @@ static Exit_status dump_local_log_entries(PRINT_EVENT_INFO *print_event_info,
30903092
IO_CACHE cache,*file= &cache;
30913093
uchar tmp_buff[BIN_LOG_HEADER_SIZE];
30923094
Exit_status retval= OK_CONTINUE;
3093-
my_time_t last_ev_when= MY_TIME_T_MAX;
30943095

30953096
if (logname && strcmp(logname, "-") != 0)
30963097
{
@@ -3164,8 +3165,10 @@ static Exit_status dump_local_log_entries(PRINT_EVENT_INFO *print_event_info,
31643165
{
31653166
char llbuff[21];
31663167
my_off_t old_off = my_b_tell(file);
3168+
int read_error;
31673169

3168-
Log_event* ev = Log_event::read_log_event(file, glob_description_event,
3170+
Log_event* ev = Log_event::read_log_event(file, &read_error,
3171+
glob_description_event,
31693172
opt_verify_binlog_checksum);
31703173
if (!ev)
31713174
{
@@ -3174,15 +3177,15 @@ static Exit_status dump_local_log_entries(PRINT_EVENT_INFO *print_event_info,
31743177
about a corruption, but treat it as EOF and move to the next binlog.
31753178
*/
31763179
if (glob_description_event->flags & LOG_EVENT_BINLOG_IN_USE_F)
3177-
file->error= 0;
3178-
else if (file->error)
3180+
read_error= 0;
3181+
else if (read_error)
31793182
{
31803183
error("Could not read entry at offset %s: "
31813184
"Error in log format or read error.",
31823185
llstr(old_off,llbuff));
31833186
goto err;
31843187
}
3185-
// else file->error == 0 means EOF, that's OK, we break in this case
3188+
// else read_error == 0 means EOF, that's OK, we break in this case
31863189

31873190
/*
31883191
Emit a warning in the event that we finished processing input
@@ -3196,21 +3199,8 @@ static Exit_status dump_local_log_entries(PRINT_EVENT_INFO *print_event_info,
31963199
"end of input", stop_position);
31973200
}
31983201

3199-
/*
3200-
Emit a warning in the event that we finished processing input
3201-
before reaching the boundary indicated by --stop-datetime.
3202-
*/
3203-
if (stop_datetime_given &&
3204-
stop_datetime > last_ev_when)
3205-
{
3206-
retval = OK_STOP;
3207-
warning("Did not reach stop datetime '%s' "
3208-
"before end of input", stop_datetime_str);
3209-
}
3210-
32113202
goto end;
32123203
}
3213-
last_ev_when= ev->when;
32143204
if ((retval= process_event(print_event_info, ev, old_off, logname)) !=
32153205
OK_CONTINUE)
32163206
goto end;
@@ -3389,6 +3379,10 @@ int main(int argc, char** argv)
33893379
start_position= BIN_LOG_HEADER_SIZE;
33903380
}
33913381

3382+
if (stop_datetime_given && stop_datetime > last_processed_datetime)
3383+
warning("Did not reach stop datetime '%s' before end of input",
3384+
stop_datetime_str);
3385+
33923386
/*
33933387
If enable flashback, need to print the events from the end to the
33943388
beginning

client/mysqldump.cc

Lines changed: 35 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,9 @@
103103
#define DUMP_TABLE_TABLE 0
104104
#define DUMP_TABLE_SEQUENCE 1
105105

106+
/* until MDEV-35831 is implemented, we'll have to detect VECTOR by name */
107+
#define MYSQL_TYPE_VECTOR "V"
108+
106109
static my_bool ignore_table_data(const uchar *hash_key, size_t len);
107110
static void add_load_option(DYNAMIC_STRING *str, const char *option,
108111
const char *option_value);
@@ -147,7 +150,7 @@ static my_bool insert_pat_inited= 0, debug_info_flag= 0, debug_check_flag= 0,
147150
static ulong opt_max_allowed_packet, opt_net_buffer_length;
148151
static double opt_max_statement_time= 0.0;
149152
static MYSQL *mysql=0;
150-
static DYNAMIC_STRING insert_pat, select_field_names,
153+
static DYNAMIC_STRING insert_pat, select_field_names, field_flags,
151154
select_field_names_for_header, insert_field_names;
152155
static char *opt_password=0,*current_user=0,
153156
*current_host=0,*path=0,*fields_terminated=0,
@@ -2009,6 +2012,7 @@ static void free_resources()
20092012
dynstr_free(&dynamic_where);
20102013
dynstr_free(&insert_pat);
20112014
dynstr_free(&select_field_names);
2015+
dynstr_free(&field_flags);
20122016
dynstr_free(&select_field_names_for_header);
20132017
dynstr_free(&insert_field_names);
20142018
if (defaults_argv)
@@ -3181,13 +3185,15 @@ static uint get_table_structure(const char *table, const char *db, char *table_t
31813185
{
31823186
select_field_names_inited= 1;
31833187
init_dynamic_string_checked(&select_field_names, "", 1024, 1024);
3188+
init_dynamic_string_checked(&field_flags, "", 1024, 1024);
31843189
init_dynamic_string_checked(&insert_field_names, "", 1024, 1024);
31853190
if (opt_header)
31863191
init_dynamic_string_checked(&select_field_names_for_header, "", 1024, 1024);
31873192
}
31883193
else
31893194
{
31903195
dynstr_set_checked(&select_field_names, "");
3196+
dynstr_set_checked(&field_flags, "");
31913197
dynstr_set_checked(&insert_field_names, "");
31923198
if (opt_header)
31933199
dynstr_set_checked(&select_field_names_for_header, "");
@@ -3355,7 +3361,7 @@ static uint get_table_structure(const char *table, const char *db, char *table_t
33553361

33563362
fprintf(sql_file,
33573363
"SET @saved_cs_client = @@character_set_client;\n"
3358-
"SET character_set_client = utf8;\n"
3364+
"SET character_set_client = utf8mb4;\n"
33593365
"/*!50001 CREATE VIEW %s AS SELECT\n",
33603366
result_table);
33613367

@@ -3423,7 +3429,7 @@ static uint get_table_structure(const char *table, const char *db, char *table_t
34233429
{
34243430
fprintf(sql_file,
34253431
"/*!40101 SET @saved_cs_client = @@character_set_client */;\n"
3426-
"/*!40101 SET character_set_client = utf8 */;\n"
3432+
"/*!40101 SET character_set_client = utf8mb4 */;\n"
34273433
"%s%s;\n"
34283434
"/*!40101 SET character_set_client = @saved_cs_client */;\n",
34293435
is_log_table ? "CREATE TABLE IF NOT EXISTS " : "",
@@ -3489,6 +3495,11 @@ static uint get_table_structure(const char *table, const char *db, char *table_t
34893495
if (opt_header)
34903496
dynstr_append_checked(&select_field_names_for_header,
34913497
quote_for_equal(row[0], name_buff));
3498+
/* VECTOR doesn't have a type code yet, must be detected by name */
3499+
if (row[3] && strcmp(row[3], "vector") == 0)
3500+
dynstr_append_checked(&field_flags, MYSQL_TYPE_VECTOR);
3501+
else
3502+
dynstr_append_checked(&field_flags, " ");
34923503
}
34933504

34943505
if (vers_hidden)
@@ -3502,6 +3513,7 @@ static uint get_table_structure(const char *table, const char *db, char *table_t
35023513
"row_end" :
35033514
"row_end");
35043515
dynstr_append_checked(&insert_field_names, ", row_start, row_end");
3516+
dynstr_append_checked(&field_flags, " ");
35053517
}
35063518

35073519
/*
@@ -3608,6 +3620,11 @@ static uint get_table_structure(const char *table, const char *db, char *table_t
36083620
while ((row= mysql_fetch_row(result)))
36093621
{
36103622
ulong *lengths= mysql_fetch_lengths(result);
3623+
/* VECTOR doesn't have a type code yet, must be detected by name */
3624+
if (strncmp(row[SHOW_TYPE], STRING_WITH_LEN("vector(")) == 0)
3625+
dynstr_append_checked(&field_flags, MYSQL_TYPE_VECTOR);
3626+
else
3627+
dynstr_append_checked(&field_flags, " ");
36113628
if (init)
36123629
{
36133630
if (!opt_xml && !opt_no_create_info)
@@ -4491,21 +4508,23 @@ static void dump_table(const char *table, const char *db, const uchar *hash_key,
44914508
"Not enough fields from table %s! Aborting.\n",
44924509
result_table);
44934510

4511+
DBUG_ASSERT(field_flags.length > i);
44944512
/*
44954513
63 is my_charset_bin. If charsetnr is not 63,
44964514
we have not a BLOB but a TEXT column.
44974515
we'll dump in hex only BLOB columns.
44984516
*/
4499-
is_blob= (opt_hex_blob && field->charsetnr == 63 &&
4500-
(field->type == MYSQL_TYPE_BIT ||
4501-
field->type == MYSQL_TYPE_STRING ||
4502-
field->type == MYSQL_TYPE_VAR_STRING ||
4503-
field->type == MYSQL_TYPE_VARCHAR ||
4504-
field->type == MYSQL_TYPE_BLOB ||
4505-
field->type == MYSQL_TYPE_LONG_BLOB ||
4506-
field->type == MYSQL_TYPE_MEDIUM_BLOB ||
4507-
field->type == MYSQL_TYPE_TINY_BLOB ||
4508-
field->type == MYSQL_TYPE_GEOMETRY)) ? 1 : 0;
4517+
is_blob= field->type == MYSQL_TYPE_GEOMETRY ||
4518+
field->type == MYSQL_TYPE_BIT ||
4519+
field_flags.str[i] == MYSQL_TYPE_VECTOR[0] ||
4520+
(opt_hex_blob && field->charsetnr == 63 &&
4521+
(field->type == MYSQL_TYPE_STRING ||
4522+
field->type == MYSQL_TYPE_VAR_STRING ||
4523+
field->type == MYSQL_TYPE_VARCHAR ||
4524+
field->type == MYSQL_TYPE_BLOB ||
4525+
field->type == MYSQL_TYPE_LONG_BLOB ||
4526+
field->type == MYSQL_TYPE_MEDIUM_BLOB ||
4527+
field->type == MYSQL_TYPE_TINY_BLOB));
45094528
if (extended_insert && !opt_xml)
45104529
{
45114530
if (i == 0)
@@ -4528,7 +4547,7 @@ static void dump_table(const char *table, const char *db, const uchar *hash_key,
45284547
Also we need to reserve 1 byte for terminating '\0'.
45294548
*/
45304549
dynstr_realloc_checked(&extended_row,length * 2 + 2 + 1);
4531-
if (opt_hex_blob && is_blob)
4550+
if (is_blob)
45324551
{
45334552
dynstr_append_checked(&extended_row, "0x");
45344553
extended_row.length+= mysql_hex_string(extended_row.str +
@@ -4589,7 +4608,7 @@ static void dump_table(const char *table, const char *db, const uchar *hash_key,
45894608
{
45904609
if (opt_xml)
45914610
{
4592-
if (opt_hex_blob && is_blob && length)
4611+
if (is_blob && length)
45934612
{
45944613
/* Define xsi:type="xs:hexBinary" for hex encoded data */
45954614
print_xml_tag(md_result_file, "\t\t", "", "field", "name=",
@@ -4604,7 +4623,7 @@ static void dump_table(const char *table, const char *db, const uchar *hash_key,
46044623
}
46054624
fputs("</field>\n", md_result_file);
46064625
}
4607-
else if (opt_hex_blob && is_blob && length)
4626+
else if (is_blob && length)
46084627
{
46094628
fputs("0x", md_result_file);
46104629
print_blob_as_hex(md_result_file, row[i], length);

0 commit comments

Comments
 (0)