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
9fefe973
Commit
9fefe973
authored
Dec 22, 2016
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'mysql/5.5' into 5.5
parents
8fcdd6b0
c8f0eeb9
Changes
11
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
127 additions
and
127 deletions
+127
-127
client/mysqladmin.cc
client/mysqladmin.cc
+4
-2
mysql-test/r/loaddata.result
mysql-test/r/loaddata.result
+1
-25
mysql-test/std_data/bug20683959loaddata.txt
mysql-test/std_data/bug20683959loaddata.txt
+0
-1
mysql-test/t/loaddata.test
mysql-test/t/loaddata.test
+1
-24
sql/field.cc
sql/field.cc
+9
-6
sql/item_subselect.cc
sql/item_subselect.cc
+7
-4
sql/mysqld.cc
sql/mysqld.cc
+17
-4
sql/sql_load.cc
sql/sql_load.cc
+28
-49
sql/sql_select.cc
sql/sql_select.cc
+3
-0
sql/sql_yacc.yy
sql/sql_yacc.yy
+15
-1
storage/innobase/mach/mach0data.c
storage/innobase/mach/mach0data.c
+42
-11
No files found.
client/mysqladmin.cc
View file @
9fefe973
...
...
@@ -1516,7 +1516,9 @@ static my_bool get_pidfile(MYSQL *mysql, char *pidfile)
if
(
mysql_query
(
mysql
,
"SHOW VARIABLES LIKE 'pid_file'"
))
{
my_printf_error
(
0
,
"query failed; error: '%s'"
,
error_flags
,
my_printf_error
(
mysql_errno
(
mysql
),
"The query to get the server's pid file failed,"
" error: '%s'. Continuing."
,
error_flags
,
mysql_error
(
mysql
));
}
result
=
mysql_store_result
(
mysql
);
...
...
mysql-test/r/loaddata.result
View file @
9fefe973
...
...
@@ -507,7 +507,7 @@ DROP TABLE t1;
# Bug#11765139 58069: LOAD DATA INFILE: VALGRIND REPORTS INVALID MEMORY READS AND WRITES WITH U
#
CREATE TABLE t1(f1 INT);
SELECT 0xE1
C3
30 INTO OUTFILE 't1.dat';
SELECT 0xE1
BB
30 INTO OUTFILE 't1.dat';
LOAD DATA INFILE 't1.dat' IGNORE INTO TABLE t1 CHARACTER SET utf8;
DROP TABLE t1;
#
...
...
@@ -532,27 +532,3 @@ FIELDS TERMINATED BY 't' LINES TERMINATED BY '';
Got one of the listed errors
SET @@sql_mode= @old_mode;
DROP TABLE t1;
#
# Bug#23080148 - Backport of Bug#20683959.
# Bug#20683959 LOAD DATA INFILE IGNORES A SPECIFIC ROW SILENTLY
# UNDER DB CHARSET IS UTF8.
#
CREATE DATABASE d1 CHARSET latin1;
USE d1;
CREATE TABLE t1 (val TEXT);
LOAD DATA INFILE '../../std_data/bug20683959loaddata.txt' INTO TABLE t1;
SELECT COUNT(*) FROM t1;
COUNT(*)
1
SELECT HEX(val) FROM t1;
HEX(val)
C38322525420406E696F757A656368756E3A20E98198E2889AF58081AEE7B99DE4B88AE383A3E7B99DE69690F58087B3E7B9A7EFBDA8E7B99DEFBDB3E7B99DE78999E880B3E7B8BAEFBDAAE7B9A7E89699E296A1E7B8BAE4BBA3EFBD8CE7B8BAEFBDA9E7B8B2E2889AE38184E7B99DEFBDB3E7B99DE4B88AE383A3E7B99DE69690F58087B3E7B9A7EFBDA8E7B99DEFBDB3E7B99DE5B3A8EFBD84E8ABA0EFBDA8E89C89F580948EE599AAE7B8BAEFBDAAE7B8BAE9A198EFBDA9EFBDB1E7B9A7E581B5E289A0E7B8BAEFBDBEE7B9A7E9A194EFBDA9E882B4EFBDA5EFBDB5E980A7F5808B96E28693E99EABE38287E58F99E7B8BAE58AB1E28691E7B8BAF5808B9AE7828AE98095EFBDB1E7B8BAEFBDAFE7B8B2E288ABE6A89FE89EB3E6BA98F58081ADE88EA0EFBDBAE98095E6BA98F58081AEE89D93EFBDBAE8AD9BEFBDACE980A7F5808B96E28693E7B8BAF580918EE288AAE7B8BAE4B88AEFBC9EE7B8BAE4B99DE28691E7B8BAF5808B96EFBCA0E88DB3E6A68AEFBDB9EFBDB3E981B2E5B3A8E296A1E7B8BAE7A4BCE7828AE88DB3E6A68AEFBDB0EFBDBDE7B8BAA0E7B8BAE88B93EFBDBEE5B899EFBC9E
CREATE DATABASE d2 CHARSET utf8;
USE d2;
CREATE TABLE t1 (val TEXT);
LOAD DATA INFILE '../../std_data/bug20683959loaddata.txt' INTO TABLE t1;
ERROR HY000: Invalid utf8 character string: '"RT @niouzechun: \9058\221A'
DROP TABLE d1.t1, d2.t1;
DROP DATABASE d1;
DROP DATABASE d2;
mysql-test/std_data/bug20683959loaddata.txt
deleted
100644 → 0
View file @
8fcdd6b0
Ã"RT @niouzechun: 遘√繝上ャ繝斐繧ィ繝ウ繝牙耳縺ェ繧薙□縺代l縺ゥ縲√い繝ウ繝上ャ繝斐繧ィ繝ウ繝峨d諠ィ蜉噪縺ェ縺願ゥア繧偵≠縺セ繧顔ゥ肴・オ逧↓鞫ょ叙縺励↑縺炊逕ア縺ッ縲∫樟螳溘莠コ逕溘蝓コ譛ャ逧↓縺∪縺上>縺九↑縺@荳榊ケウ遲峨□縺礼炊荳榊ース縺縺苓セ帙>
mysql-test/t/loaddata.test
View file @
9fefe973
...
...
@@ -612,7 +612,7 @@ disconnect con1;
--
echo
#
CREATE
TABLE
t1
(
f1
INT
);
EVAL
SELECT
0xE1
C3
30
INTO
OUTFILE
't1.dat'
;
EVAL
SELECT
0xE1
BB
30
INTO
OUTFILE
't1.dat'
;
--
disable_warnings
LOAD
DATA
INFILE
't1.dat'
IGNORE
INTO
TABLE
t1
CHARACTER
SET
utf8
;
--
enable_warnings
...
...
@@ -658,26 +658,3 @@ SET @@sql_mode= @old_mode;
--
remove_file
$MYSQLTEST_VARDIR
/
mysql
DROP
TABLE
t1
;
--
echo
--
echo
#
--
echo
# Bug#23080148 - Backport of Bug#20683959.
--
echo
# Bug#20683959 LOAD DATA INFILE IGNORES A SPECIFIC ROW SILENTLY
--
echo
# UNDER DB CHARSET IS UTF8.
--
echo
#
CREATE
DATABASE
d1
CHARSET
latin1
;
USE
d1
;
CREATE
TABLE
t1
(
val
TEXT
);
LOAD
DATA
INFILE
'../../std_data/bug20683959loaddata.txt'
INTO
TABLE
t1
;
SELECT
COUNT
(
*
)
FROM
t1
;
SELECT
HEX
(
val
)
FROM
t1
;
CREATE
DATABASE
d2
CHARSET
utf8
;
USE
d2
;
CREATE
TABLE
t1
(
val
TEXT
);
--
error
ER_INVALID_CHARACTER_STRING
LOAD
DATA
INFILE
'../../std_data/bug20683959loaddata.txt'
INTO
TABLE
t1
;
DROP
TABLE
d1
.
t1
,
d2
.
t1
;
DROP
DATABASE
d1
;
DROP
DATABASE
d2
;
sql/field.cc
View file @
9fefe973
...
...
@@ -1156,13 +1156,16 @@ void Field_num::prepend_zeros(String *value)
{
int
diff
;
if
((
diff
=
(
int
)
(
field_length
-
value
->
length
()))
>
0
)
{
const
bool
error
=
value
->
realloc
(
field_length
);
if
(
!
error
)
{
bmove_upp
((
uchar
*
)
value
->
ptr
()
+
field_length
,
(
uchar
*
)
value
->
ptr
()
+
value
->
length
(),
value
->
length
());
bfill
((
uchar
*
)
value
->
ptr
(),
diff
,
'0'
);
value
->
length
(
field_length
);
(
void
)
value
->
c_ptr_quick
();
// Avoid warnings in purify
}
}
}
...
...
sql/item_subselect.cc
View file @
9fefe973
/* Copyright (c) 2002, 201
5
, Oracle and/or its affiliates.
Copyright (c) 2010, 201
5
, MariaDB
/* Copyright (c) 2002, 201
6
, Oracle and/or its affiliates.
Copyright (c) 2010, 201
6
, MariaDB
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
...
...
@@ -2969,8 +2969,12 @@ bool subselect_union_engine::is_executed() const
bool
subselect_union_engine
::
no_rows
()
{
bool
rows_present
=
false
;
/* Check if we got any rows when reading UNION result from temp. table: */
return
test
(
!
unit
->
fake_select_lex
->
join
->
send_records
);
if
(
unit
->
fake_select_lex
->
join
)
rows_present
=
test
(
!
unit
->
fake_select_lex
->
join
->
send_records
);
return
rows_present
;
}
...
...
@@ -6105,4 +6109,3 @@ bool subselect_table_scan_engine::partial_match()
void
subselect_table_scan_engine
::
cleanup
()
{
}
sql/mysqld.cc
View file @
9fefe973
...
...
@@ -3746,9 +3746,23 @@ static int init_common_variables()
/* Set collactions that depends on the default collation */
global_system_variables
.
collation_server
=
default_charset_info
;
global_system_variables
.
collation_database
=
default_charset_info
;
if
(
is_supported_parser_charset
(
default_charset_info
))
{
global_system_variables
.
collation_connection
=
default_charset_info
;
global_system_variables
.
character_set_results
=
default_charset_info
;
global_system_variables
.
character_set_client
=
default_charset_info
;
}
else
{
sql_print_information
(
"'%s' can not be used as client character set. "
"'%s' will be used as default client character set."
,
default_charset_info
->
csname
,
my_charset_latin1
.
csname
);
global_system_variables
.
collation_connection
=
&
my_charset_latin1
;
global_system_variables
.
character_set_results
=
&
my_charset_latin1
;
global_system_variables
.
character_set_client
=
&
my_charset_latin1
;
}
if
(
!
(
character_set_filesystem
=
get_charset_by_csname
(
character_set_filesystem_name
,
...
...
@@ -8379,4 +8393,3 @@ template class I_List<i_string_pair>;
template
class
I_List
<
Statement
>;
template
class
I_List_iterator
<
Statement
>;
#endif
sql/sql_load.cc
View file @
9fefe973
...
...
@@ -1389,8 +1389,8 @@ READ_INFO::READ_INFO(File file_par, uint tot_length, CHARSET_INFO *cs,
set_if_bigger
(
length
,
line_start
.
length
());
stack
=
stack_pos
=
(
int
*
)
sql_alloc
(
sizeof
(
int
)
*
length
);
if
(
!
(
buffer
=
(
uchar
*
)
my_malloc
(
buff_length
+
1
,
MYF
(
MY_WME
))))
error
=
true
;
/* purecov: inspected */
if
(
!
(
buffer
=
(
uchar
*
)
my_malloc
(
buff_length
+
1
,
MYF
(
0
))))
error
=
1
;
/* purecov: inspected */
else
{
end_of_buff
=
buffer
+
buff_length
;
...
...
@@ -1581,23 +1581,16 @@ int READ_INFO::read_field()
}
}
#ifdef USE_MB
uint
ml
=
my_mbcharlen
(
read_charset
,
chr
);
if
(
ml
==
0
)
{
*
to
=
'\0'
;
my_error
(
ER_INVALID_CHARACTER_STRING
,
MYF
(
0
),
read_charset
->
csname
,
buffer
);
error
=
true
;
return
1
;
}
if
(
ml
>
1
&&
to
+
ml
<=
end_of_buff
)
if
(
my_mbcharlen
(
read_charset
,
chr
)
>
1
&&
to
+
my_mbcharlen
(
read_charset
,
chr
)
<=
end_of_buff
)
{
uchar
*
p
=
to
;
int
ml
,
i
;
*
to
++
=
chr
;
for
(
uint
i
=
1
;
i
<
ml
;
i
++
)
ml
=
my_mbcharlen
(
read_charset
,
chr
);
for
(
i
=
1
;
i
<
ml
;
i
++
)
{
chr
=
GET
;
if
(
chr
==
my_b_EOF
)
...
...
@@ -1615,16 +1608,10 @@ int READ_INFO::read_field()
(
const
char
*
)
p
,
(
const
char
*
)
to
))
continue
;
for
(
uint
i
=
0
;
i
<
ml
;
i
++
)
for
(
i
=
0
;
i
<
ml
;
i
++
)
PUSH
(
*--
to
);
chr
=
GET
;
}
else
if
(
ml
>
1
)
{
// Buffer is too small, exit while loop, and reallocate.
PUSH
(
chr
);
break
;
}
#endif
*
to
++
=
(
uchar
)
chr
;
}
...
...
@@ -1868,15 +1855,7 @@ int READ_INFO::read_value(int delim, String *val)
for
(
chr
=
GET
;
my_tospace
(
chr
)
!=
delim
&&
chr
!=
my_b_EOF
;)
{
#ifdef USE_MB
uint
ml
=
my_mbcharlen
(
read_charset
,
chr
);
if
(
ml
==
0
)
{
chr
=
my_b_EOF
;
val
->
length
(
0
);
return
chr
;
}
if
(
ml
>
1
)
if
(
my_mbcharlen
(
read_charset
,
chr
)
>
1
)
{
DBUG_PRINT
(
"read_xml"
,(
"multi byte"
));
int
i
,
ml
=
my_mbcharlen
(
read_charset
,
chr
);
...
...
sql/sql_select.cc
View file @
9fefe973
...
...
@@ -11946,6 +11946,9 @@ static COND *build_equal_items_for_cond(THD *thd, COND *cond,
COND_EQUAL
cond_equal
;
cond_equal
.
upper_levels
=
inherited
;
if
(
check_stack_overrun
(
thd
,
STACK_MIN_SIZE
,
NULL
))
return
cond
;
// Fatal error flag is set!
if
(
cond
->
type
()
==
Item
::
COND_ITEM
)
{
List
<
Item
>
eq_list
;
...
...
sql/sql_yacc.yy
View file @
9fefe973
...
...
@@ -4670,6 +4670,12 @@ part_name:
{
partition_info *part_info= Lex->part_info;
partition_element *p_elem= part_info->curr_part_elem;
if (check_string_char_length(&$1, "", NAME_CHAR_LEN,
system_charset_info, true))
{
my_error(ER_TOO_LONG_IDENT, MYF(0), $1.str);
MYSQL_YYABORT;
}
p_elem->partition_name= $1.str;
}
;
...
...
@@ -4964,7 +4970,15 @@ sub_part_definition:
sub_name:
ident_or_text
{ Lex->part_info->curr_part_elem->partition_name= $1.str; }
{
if (check_string_char_length(&$1, "", NAME_CHAR_LEN,
system_charset_info, true))
{
my_error(ER_TOO_LONG_IDENT, MYF(0), $1.str);
MYSQL_YYABORT;
}
Lex->part_info->curr_part_elem->partition_name= $1.str;
}
;
opt_part_options:
...
...
storage/innobase/mach/mach0data.c
View file @
9fefe973
/*****************************************************************************
Copyright (c) 1995, 20
09, Innobase Oy
. All Rights Reserved.
Copyright (c) 1995, 20
16, Oracle and/or its affiliates
. All Rights Reserved.
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
...
...
@@ -55,8 +55,22 @@ mach_parse_compressed(
if
(
flag
<
0x80UL
)
{
*
val
=
flag
;
return
(
ptr
+
1
);
}
/* Workaround GCC bug
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77673:
the compiler moves mach_read_from_4 right to the beginning of the
function, causing and out-of-bounds read if we are reading a short
integer close to the end of buffer. */
#if defined(__GNUC__) && (__GNUC__ >= 5) && !defined(__clang__)
#define DEPLOY_FENCE
#endif
#ifdef DEPLOY_FENCE
__atomic_thread_fence
(
__ATOMIC_ACQUIRE
);
#endif
}
else
if
(
flag
<
0xC0UL
)
{
if
(
flag
<
0xC0UL
)
{
if
(
end_ptr
<
ptr
+
2
)
{
return
(
NULL
);
}
...
...
@@ -64,8 +78,13 @@ mach_parse_compressed(
*
val
=
mach_read_from_2
(
ptr
)
&
0x7FFFUL
;
return
(
ptr
+
2
);
}
#ifdef DEPLOY_FENCE
__atomic_thread_fence
(
__ATOMIC_ACQUIRE
);
#endif
}
else
if
(
flag
<
0xE0UL
)
{
if
(
flag
<
0xE0UL
)
{
if
(
end_ptr
<
ptr
+
3
)
{
return
(
NULL
);
}
...
...
@@ -73,7 +92,13 @@ mach_parse_compressed(
*
val
=
mach_read_from_3
(
ptr
)
&
0x3FFFFFUL
;
return
(
ptr
+
3
);
}
else
if
(
flag
<
0xF0UL
)
{
}
#ifdef DEPLOY_FENCE
__atomic_thread_fence
(
__ATOMIC_ACQUIRE
);
#endif
if
(
flag
<
0xF0UL
)
{
if
(
end_ptr
<
ptr
+
4
)
{
return
(
NULL
);
}
...
...
@@ -81,7 +106,14 @@ mach_parse_compressed(
*
val
=
mach_read_from_4
(
ptr
)
&
0x1FFFFFFFUL
;
return
(
ptr
+
4
);
}
else
{
}
#ifdef DEPLOY_FENCE
__atomic_thread_fence
(
__ATOMIC_ACQUIRE
);
#endif
#undef DEPLOY_FENCE
ut_ad
(
flag
==
0xF0UL
);
if
(
end_ptr
<
ptr
+
5
)
{
...
...
@@ -90,5 +122,4 @@ mach_parse_compressed(
*
val
=
mach_read_from_4
(
ptr
+
1
);
return
(
ptr
+
5
);
}
}
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