Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
77103e98
Commit
77103e98
authored
Mar 06, 2019
by
Marko Mäkelä
Browse files
Options
Browse Files
Download
Plain Diff
Merge 10.2 into 10.3
parents
723ffdb3
c155946c
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
87 additions
and
53 deletions
+87
-53
extra/mariabackup/backup_copy.cc
extra/mariabackup/backup_copy.cc
+2
-1
extra/mariabackup/encryption_plugin.cc
extra/mariabackup/encryption_plugin.cc
+6
-2
extra/mariabackup/fil_cur.cc
extra/mariabackup/fil_cur.cc
+4
-2
extra/mariabackup/xtrabackup.cc
extra/mariabackup/xtrabackup.cc
+5
-4
mysql-test/suite/innodb_fts/r/fulltext3.result
mysql-test/suite/innodb_fts/r/fulltext3.result
+9
-0
mysql-test/suite/innodb_fts/t/fulltext3.test
mysql-test/suite/innodb_fts/t/fulltext3.test
+9
-0
sql/sql_parse.cc
sql/sql_parse.cc
+5
-0
storage/innobase/dict/dict0dict.cc
storage/innobase/dict/dict0dict.cc
+12
-12
storage/innobase/fts/fts0fts.cc
storage/innobase/fts/fts0fts.cc
+5
-4
storage/innobase/fts/fts0opt.cc
storage/innobase/fts/fts0opt.cc
+12
-11
storage/innobase/include/dict0crea.ic
storage/innobase/include/dict0crea.ic
+6
-4
storage/innobase/row/row0ftsort.cc
storage/innobase/row/row0ftsort.cc
+6
-11
storage/innobase/row/row0mysql.cc
storage/innobase/row/row0mysql.cc
+6
-2
No files found.
extra/mariabackup/backup_copy.cc
View file @
77103e98
...
...
@@ -512,7 +512,8 @@ datafile_open(const char *file, datafile_cur_t *cursor, uint thread_n)
5.6+. We want to make "local" copies for the backup. */
strncpy
(
cursor
->
rel_path
,
xb_get_relative_path
(
cursor
->
abs_path
,
FALSE
),
sizeof
(
cursor
->
rel_path
));
(
sizeof
cursor
->
rel_path
)
-
1
);
cursor
->
rel_path
[(
sizeof
cursor
->
rel_path
)
-
1
]
=
'\0'
;
cursor
->
file
=
os_file_create_simple_no_error_handling
(
0
,
cursor
->
abs_path
,
...
...
extra/mariabackup/encryption_plugin.cc
View file @
77103e98
...
...
@@ -123,7 +123,8 @@ void encryption_plugin_backup_init(MYSQL *mysql)
/* Required to load the plugin later.*/
add_to_plugin_load_list
(
plugin_load
.
c_str
());
strncpy
(
opt_plugin_dir
,
dir
,
FN_REFLEN
);
strncpy
(
opt_plugin_dir
,
dir
,
FN_REFLEN
-
1
);
opt_plugin_dir
[
FN_REFLEN
-
1
]
=
'\0'
;
oss
<<
"plugin_dir="
<<
'"'
<<
dir
<<
'"'
<<
std
::
endl
;
...
...
@@ -193,7 +194,10 @@ void encryption_plugin_prepare_init(int argc, char **argv)
add_to_plugin_load_list
(
plugin_load
.
c_str
());
if
(
xb_plugin_dir
)
strncpy
(
opt_plugin_dir
,
xb_plugin_dir
,
FN_REFLEN
);
{
strncpy
(
opt_plugin_dir
,
xb_plugin_dir
,
FN_REFLEN
-
1
);
opt_plugin_dir
[
FN_REFLEN
-
1
]
=
'\0'
;
}
char
**
new_argv
=
new
char
*
[
argc
+
1
];
new_argv
[
0
]
=
XTRABACKUP_EXE
;
...
...
extra/mariabackup/fil_cur.cc
View file @
77103e98
...
...
@@ -147,7 +147,8 @@ xb_fil_cur_open(
cursor
->
space_id
=
node
->
space
->
id
;
strncpy
(
cursor
->
abs_path
,
node
->
name
,
sizeof
(
cursor
->
abs_path
));
strncpy
(
cursor
->
abs_path
,
node
->
name
,
(
sizeof
cursor
->
abs_path
)
-
1
);
cursor
->
abs_path
[(
sizeof
cursor
->
abs_path
)
-
1
]
=
'\0'
;
/* Get the relative path for the destination tablespace name, i.e. the
one that can be appended to the backup root directory. Non-system
...
...
@@ -155,7 +156,8 @@ xb_fil_cur_open(
We want to make "local" copies for the backup. */
strncpy
(
cursor
->
rel_path
,
xb_get_relative_path
(
cursor
->
abs_path
,
cursor
->
is_system
()),
sizeof
(
cursor
->
rel_path
));
(
sizeof
cursor
->
rel_path
)
-
1
);
cursor
->
rel_path
[(
sizeof
cursor
->
rel_path
)
-
1
]
=
'\0'
;
/* In the backup mode we should already have a tablespace handle created
by fil_ibd_load() unless it is a system
...
...
extra/mariabackup/xtrabackup.cc
View file @
77103e98
...
...
@@ -2401,8 +2401,9 @@ check_if_skip_table(
return
(
FALSE
);
}
strncpy
(
buf
,
dbname
,
FN_REFLEN
);
buf
[
tbname
-
1
-
dbname
]
=
0
;
strncpy
(
buf
,
dbname
,
FN_REFLEN
-
1
);
buf
[
FN_REFLEN
-
1
]
=
'\0'
;
buf
[
tbname
-
1
-
dbname
]
=
'\0'
;
const
skip_database_check_result
skip_database
=
check_if_skip_database
(
buf
);
...
...
@@ -2410,7 +2411,6 @@ check_if_skip_table(
return
(
TRUE
);
}
buf
[
FN_REFLEN
-
1
]
=
'\0'
;
buf
[
tbname
-
1
-
dbname
]
=
'.'
;
/* Check if there's a suffix in the table name. If so, truncate it. We
...
...
@@ -4841,7 +4841,8 @@ xtrabackup_apply_delta(
}
dst_path
[
strlen
(
dst_path
)
-
6
]
=
'\0'
;
strncpy
(
space_name
,
filename
,
FN_REFLEN
);
strncpy
(
space_name
,
filename
,
FN_REFLEN
-
1
);
space_name
[
FN_REFLEN
-
1
]
=
'\0'
;
space_name
[
strlen
(
space_name
)
-
6
]
=
0
;
if
(
!
get_meta_path
(
src_path
,
meta_path
))
{
...
...
mysql-test/suite/innodb_fts/r/fulltext3.result
View file @
77103e98
...
...
@@ -7,3 +7,12 @@ DROP TABLE t1;
CREATE TABLE t1(a VARCHAR(2) CHARACTER SET big5 COLLATE big5_chinese_ci,
FULLTEXT(a)) ENGINE=<default_engine>;
DROP TABLE t1;
CREATE TABLE t1 (a SERIAL, t TEXT, FULLTEXT f1(t), FULLTEXT f2(t)) ENGINE=InnoDB;
Warnings:
Note 1831 Duplicate index `f2`. This is deprecated and will be disallowed in a future release
INSERT INTO t1 (a,t) VALUES (1,'1'),(2,'1');
ALTER TABLE t1 ADD COLUMN g TEXT GENERATED ALWAYS AS (t) VIRTUAL;
DELETE FROM t1 WHERE a = 1;
ALTER TABLE t1 DROP INDEX f1;
INSERT INTO t1 (a,t) VALUES (1,'1');
DROP TABLE t1;
mysql-test/suite/innodb_fts/t/fulltext3.test
View file @
77103e98
...
...
@@ -35,3 +35,12 @@ FULLTEXT(a)) ENGINE=$default_engine;
DROP
TABLE
t1
;
# End of 5.1 tests
CREATE
TABLE
t1
(
a
SERIAL
,
t
TEXT
,
FULLTEXT
f1
(
t
),
FULLTEXT
f2
(
t
))
ENGINE
=
InnoDB
;
INSERT
INTO
t1
(
a
,
t
)
VALUES
(
1
,
'1'
),(
2
,
'1'
);
ALTER
TABLE
t1
ADD
COLUMN
g
TEXT
GENERATED
ALWAYS
AS
(
t
)
VIRTUAL
;
DELETE
FROM
t1
WHERE
a
=
1
;
ALTER
TABLE
t1
DROP
INDEX
f1
;
INSERT
INTO
t1
(
a
,
t
)
VALUES
(
1
,
'1'
);
DROP
TABLE
t1
;
sql/sql_parse.cc
View file @
77103e98
...
...
@@ -2442,6 +2442,11 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
thd
->
packet
.
shrink
(
thd
->
variables
.
net_buffer_length
);
// Reclaim some memory
thd
->
reset_kill_query
();
/* Ensure that killed_errmsg is released */
/*
LEX::m_sql_cmd can point to Sql_cmd allocated on thd->mem_root.
Unlink it now, before freeing the root.
*/
thd
->
lex
->
m_sql_cmd
=
NULL
;
free_root
(
thd
->
mem_root
,
MYF
(
MY_KEEP_PREALLOC
));
#if defined(ENABLED_PROFILING)
...
...
storage/innobase/dict/dict0dict.cc
View file @
77103e98
...
...
@@ -1572,13 +1572,8 @@ dict_table_rename_in_cache(
ut_ad
(
mutex_own
(
&
dict_sys
->
mutex
));
/* store the old/current name to an automatic variable */
if
(
strlen
(
table
->
name
.
m_name
)
+
1
<=
sizeof
(
old_name
))
{
strcpy
(
old_name
,
table
->
name
.
m_name
);
}
else
{
ib
::
fatal
()
<<
"Too long table name: "
<<
table
->
name
<<
", max length is "
<<
MAX_FULL_NAME_LEN
;
}
ut_a
(
strlen
(
table
->
name
.
m_name
)
<
sizeof
old_name
);
strcpy
(
old_name
,
table
->
name
.
m_name
);
fold
=
ut_fold_string
(
new_name
);
...
...
@@ -1768,7 +1763,7 @@ dict_table_rename_in_cache(
ulint
db_len
;
char
*
old_id
;
char
old_name_cs_filename
[
MAX_
TABLE_NAME_LEN
+
20
];
char
old_name_cs_filename
[
MAX_
FULL_NAME_LEN
+
1
];
uint
errors
=
0
;
/* All table names are internally stored in charset
...
...
@@ -1785,7 +1780,8 @@ dict_table_rename_in_cache(
in old_name_cs_filename */
strncpy
(
old_name_cs_filename
,
old_name
,
MAX_TABLE_NAME_LEN
);
MAX_FULL_NAME_LEN
);
old_name_cs_filename
[
MAX_FULL_NAME_LEN
]
=
'\0'
;
if
(
strstr
(
old_name
,
TEMP_TABLE_PATH_PREFIX
)
==
NULL
)
{
innobase_convert_to_system_charset
(
...
...
@@ -1807,7 +1803,9 @@ dict_table_rename_in_cache(
/* Old name already in
my_charset_filename */
strncpy
(
old_name_cs_filename
,
old_name
,
MAX_TABLE_NAME_LEN
);
MAX_FULL_NAME_LEN
);
old_name_cs_filename
[
MAX_FULL_NAME_LEN
]
=
'\0'
;
}
}
...
...
@@ -1833,7 +1831,7 @@ dict_table_rename_in_cache(
/* This is a generated >= 4.0.18 format id */
char
table_name
[
MAX_TABLE_NAME_LEN
]
=
""
;
char
table_name
[
MAX_TABLE_NAME_LEN
+
1
]
;
uint
errors
=
0
;
if
(
strlen
(
table
->
name
.
m_name
)
...
...
@@ -1848,6 +1846,7 @@ dict_table_rename_in_cache(
/* Convert the table name to UTF-8 */
strncpy
(
table_name
,
table
->
name
.
m_name
,
MAX_TABLE_NAME_LEN
);
table_name
[
MAX_TABLE_NAME_LEN
]
=
'\0'
;
innobase_convert_to_system_charset
(
strchr
(
table_name
,
'/'
)
+
1
,
strchr
(
table
->
name
.
m_name
,
'/'
)
+
1
,
...
...
@@ -1857,9 +1856,10 @@ dict_table_rename_in_cache(
/* Table name could not be converted
from charset my_charset_filename to
UTF-8. This means that the table name
is already in UTF-8 (#mysql
#50
). */
is already in UTF-8 (#mysql
50#
). */
strncpy
(
table_name
,
table
->
name
.
m_name
,
MAX_TABLE_NAME_LEN
);
table_name
[
MAX_TABLE_NAME_LEN
]
=
'\0'
;
}
/* Replace the prefix 'databasename/tablename'
...
...
storage/innobase/fts/fts0fts.cc
View file @
77103e98
/*****************************************************************************
Copyright (c) 2011, 2018, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2016, 201
8
, MariaDB Corporation.
Copyright (c) 2016, 201
9
, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
...
...
@@ -726,6 +726,7 @@ fts_reset_get_doc(
memset
(
get_doc
,
0x0
,
sizeof
(
*
get_doc
));
get_doc
->
index_cache
=
ind_cache
;
get_doc
->
cache
=
cache
;
}
ut_ad
(
ib_vector_size
(
cache
->
get_docs
)
...
...
@@ -4783,12 +4784,12 @@ fts_tokenize_document(
ut_a
(
!
doc
->
tokens
);
ut_a
(
doc
->
charset
);
doc
->
tokens
=
rbt_create_arg_cmp
(
sizeof
(
fts_token_t
),
innobase_fts_text_cmp
,
(
void
*
)
doc
->
charset
);
doc
->
tokens
=
rbt_create_arg_cmp
(
sizeof
(
fts_token_t
),
innobase_fts_text_cmp
,
(
void
*
)
doc
->
charset
);
if
(
parser
!=
NULL
)
{
fts_tokenize_param_t
fts_param
;
fts_param
.
result_doc
=
(
result
!=
NULL
)
?
result
:
doc
;
fts_param
.
add_pos
=
0
;
...
...
storage/innobase/fts/fts0opt.cc
View file @
77103e98
/*****************************************************************************
Copyright (c) 2007, 2018, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2016, 201
8
, MariaDB Corporation.
Copyright (c) 2016, 201
9
, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
...
...
@@ -674,25 +674,27 @@ fts_fetch_index_words(
fts_zip_t
*
zip
=
static_cast
<
fts_zip_t
*>
(
user_arg
);
que_node_t
*
exp
=
sel_node
->
select_list
;
dfield_t
*
dfield
=
que_node_get_val
(
exp
);
short
len
=
static_cast
<
short
>
(
dfield_get_len
(
dfield
));
ut_a
(
dfield_get_len
(
dfield
)
<=
FTS_MAX_WORD_LEN
);
uint16
len
=
uint16
(
dfield_get_len
(
dfield
));
void
*
data
=
dfield_get_data
(
dfield
);
/* Skip the duplicate words. */
if
(
zip
->
word
.
f_len
==
static_cast
<
ulint
>
(
len
)
&&
!
memcmp
(
zip
->
word
.
f_str
,
data
,
zip
->
word
.
f_len
))
{
if
(
zip
->
word
.
f_len
==
len
&&
!
memcmp
(
zip
->
word
.
f_str
,
data
,
len
))
{
return
(
TRUE
);
}
ut_a
(
len
<=
FTS_MAX_WORD_LEN
);
zip
->
word
.
f_len
=
ulint
(
len
);
memcpy
(
zip
->
word
.
f_str
,
data
,
zip
->
word
.
f_len
);
memcpy
(
zip
->
word
.
f_str
,
data
,
len
);
zip
->
word
.
f_len
=
len
;
ut_a
(
zip
->
zp
->
avail_in
==
0
);
ut_a
(
zip
->
zp
->
next_in
==
NULL
);
/* The string is prefixed by len. */
/* FIXME: This is not byte order agnostic (InnoDB data files
with FULLTEXT INDEX are not portable between little-endian and
big-endian systems!) */
zip
->
zp
->
next_in
=
reinterpret_cast
<
byte
*>
(
&
len
);
zip
->
zp
->
avail_in
=
sizeof
(
len
);
...
...
@@ -720,14 +722,13 @@ fts_fetch_index_words(
ut_a
(
len
<=
FTS_MAX_WORD_LEN
);
len
=
0
;
}
break
;
continue
;
case
Z_STREAM_END
:
case
Z_BUF_ERROR
:
case
Z_STREAM_ERROR
:
default:
ut_error
;
break
;
}
}
...
...
storage/innobase/include/dict0crea.ic
View file @
77103e98
/*****************************************************************************
Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2019, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
...
...
@@ -68,11 +69,11 @@ dict_create_add_foreign_id(
sprintf(id, "%s_ibfk_%lu", name,
(ulong) (*id_nr)++);
} else {
char table_name[MAX_TABLE_NAME_LEN + 2
0] = ""
;
char table_name[MAX_TABLE_NAME_LEN + 2
1]
;
uint errors = 0;
strncpy(table_name, name,
MAX_TABLE_NAME_LEN + 20)
;
strncpy(table_name, name,
(sizeof table_name) - 1);
table_name[(sizeof table_name) - 1] = '\0'
;
innobase_convert_to_system_charset(
strchr(table_name, '/') + 1,
...
...
@@ -81,7 +82,8 @@ dict_create_add_foreign_id(
if (errors) {
strncpy(table_name, name,
MAX_TABLE_NAME_LEN + 20);
(sizeof table_name) - 1);
table_name[(sizeof table_name) - 1] = '\0';
}
/* no overflow if number < 1e13 */
...
...
storage/innobase/row/row0ftsort.cc
View file @
77103e98
...
...
@@ -96,8 +96,8 @@ row_merge_create_fts_sort_index(
field
=
dict_index_get_nth_field
(
new_index
,
0
);
field
->
name
=
NULL
;
field
->
prefix_len
=
0
;
field
->
col
=
static_cast
<
dict_col_t
*>
(
mem_heap_alloc
(
new_index
->
heap
,
sizeof
(
dict_col_t
))
);
field
->
col
=
new
(
mem_heap_zalloc
(
new_index
->
heap
,
sizeof
(
dict_col_t
)))
dict_col_t
(
);
field
->
col
->
prtype
=
idx_field
->
col
->
prtype
|
DATA_NOT_NULL
;
field
->
col
->
mtype
=
charset
==
&
my_charset_latin1
?
DATA_VARCHAR
:
DATA_VARMYSQL
;
...
...
@@ -111,8 +111,8 @@ row_merge_create_fts_sort_index(
field
=
dict_index_get_nth_field
(
new_index
,
1
);
field
->
name
=
NULL
;
field
->
prefix_len
=
0
;
field
->
col
=
static_cast
<
dict_col_t
*>
(
mem_heap_alloc
(
new_index
->
heap
,
sizeof
(
dict_col_t
))
);
field
->
col
=
new
(
mem_heap_zalloc
(
new_index
->
heap
,
sizeof
(
dict_col_t
)))
dict_col_t
(
);
field
->
col
->
mtype
=
DATA_INT
;
*
opt_doc_id_size
=
FALSE
;
...
...
@@ -146,21 +146,16 @@ row_merge_create_fts_sort_index(
field
->
col
->
prtype
=
DATA_NOT_NULL
|
DATA_BINARY_TYPE
;
field
->
col
->
mbminlen
=
0
;
field
->
col
->
mbmaxlen
=
0
;
/* The third field is on the word's position in the original doc */
field
=
dict_index_get_nth_field
(
new_index
,
2
);
field
->
name
=
NULL
;
field
->
prefix_len
=
0
;
field
->
col
=
static_cast
<
dict_col_t
*>
(
mem_heap_alloc
(
new_index
->
heap
,
sizeof
(
dict_col_t
))
);
field
->
col
=
new
(
mem_heap_zalloc
(
new_index
->
heap
,
sizeof
(
dict_col_t
)))
dict_col_t
(
);
field
->
col
->
mtype
=
DATA_INT
;
field
->
col
->
len
=
4
;
field
->
fixed_len
=
4
;
field
->
col
->
prtype
=
DATA_NOT_NULL
;
field
->
col
->
mbminlen
=
0
;
field
->
col
->
mbmaxlen
=
0
;
return
(
new_index
);
}
...
...
storage/innobase/row/row0mysql.cc
View file @
77103e98
...
...
@@ -4358,11 +4358,12 @@ row_rename_table_for_mysql(
if
(
!
new_is_tmp
)
{
/* Rename all constraints. */
char
new_table_name
[
MAX_TABLE_NAME_LEN
]
=
""
;
char
old_table_utf8
[
MAX_TABLE_NAME_LEN
]
=
""
;
char
new_table_name
[
MAX_TABLE_NAME_LEN
+
1
]
;
char
old_table_utf8
[
MAX_TABLE_NAME_LEN
+
1
]
;
uint
errors
=
0
;
strncpy
(
old_table_utf8
,
old_name
,
MAX_TABLE_NAME_LEN
);
old_table_utf8
[
MAX_TABLE_NAME_LEN
]
=
'\0'
;
innobase_convert_to_system_charset
(
strchr
(
old_table_utf8
,
'/'
)
+
1
,
strchr
(
old_name
,
'/'
)
+
1
,
...
...
@@ -4373,6 +4374,7 @@ row_rename_table_for_mysql(
my_charset_filename to UTF-8. This means that the
table name is already in UTF-8 (#mysql#50). */
strncpy
(
old_table_utf8
,
old_name
,
MAX_TABLE_NAME_LEN
);
old_table_utf8
[
MAX_TABLE_NAME_LEN
]
=
'\0'
;
}
info
=
pars_info_create
();
...
...
@@ -4383,6 +4385,7 @@ row_rename_table_for_mysql(
old_table_utf8
);
strncpy
(
new_table_name
,
new_name
,
MAX_TABLE_NAME_LEN
);
new_table_name
[
MAX_TABLE_NAME_LEN
]
=
'\0'
;
innobase_convert_to_system_charset
(
strchr
(
new_table_name
,
'/'
)
+
1
,
strchr
(
new_name
,
'/'
)
+
1
,
...
...
@@ -4393,6 +4396,7 @@ row_rename_table_for_mysql(
my_charset_filename to UTF-8. This means that the
table name is already in UTF-8 (#mysql#50). */
strncpy
(
new_table_name
,
new_name
,
MAX_TABLE_NAME_LEN
);
new_table_name
[
MAX_TABLE_NAME_LEN
]
=
'\0'
;
}
pars_info_add_str_literal
(
info
,
"new_table_utf8"
,
new_table_name
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment