Skip to content

Commit

Permalink
Merge 10.0 into 10.1
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-m committed Dec 12, 2017
2 parents de76cbd + 6224666 commit ce07d09
Show file tree
Hide file tree
Showing 16 changed files with 145 additions and 28 deletions.
4 changes: 2 additions & 2 deletions client/mysql_upgrade.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@ static struct my_option my_long_options[]=
"server with which it was built/distributed.",
&opt_version_check, &opt_version_check, 0,
GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
{"write-binlog", OPT_WRITE_BINLOG, "All commands including those, "
"issued by mysqlcheck, are written to the binary log.",
{"write-binlog", OPT_WRITE_BINLOG, "All commands including those "
"issued by mysqlcheck are written to the binary log.",
&opt_write_binlog, &opt_write_binlog, 0, GET_BOOL, NO_ARG,
0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
Expand Down
6 changes: 6 additions & 0 deletions include/ma_dyncol.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@ typedef struct st_mysql_lex_string LEX_STRING;
/* NO and OK is the same used just to show semantics */
#define ER_DYNCOL_NO ER_DYNCOL_OK

#ifdef HAVE_CHARSET_utf8mb4
#define DYNCOL_UTF (&my_charset_utf8mb4_general_ci)
#else
#define DYNCOL_UTF (&my_charset_utf8_general_ci)
#endif

enum enum_dyncol_func_result
{
ER_DYNCOL_OK= 0,
Expand Down
3 changes: 1 addition & 2 deletions man/mysql_upgrade.1
Original file line number Diff line number Diff line change
Expand Up @@ -691,8 +691,7 @@ it was built/distributed. Defaults to on; use \fB\-\-skip\-version\-check\fR to
.sp
Cause binary logging to be enabled while
\fBmysql_upgrade\fR
runs\&. This is the default behavior; to disable binary logging during the upgrade, use the inverse of this option (that is, start the program with
\fB\-\-skip\-write\-binlog\fR)\&.
runs\&.
.RE
.SH "COPYRIGHT"
.br
Expand Down
15 changes: 15 additions & 0 deletions mysql-test/r/ctype_utf8.result
Original file line number Diff line number Diff line change
Expand Up @@ -10264,6 +10264,21 @@ DROP FUNCTION iswellformed;
DROP TABLE allbytes;
# End of ctype_backslash.inc
#
# MDEV-12681 Wrong VIEW results for CHAR(0xDF USING latin1)
#
SET NAMES utf8;
SELECT CHAR(0xDF USING latin1);
CHAR(0xDF USING latin1)
ß
CREATE OR REPLACE VIEW v1 AS SELECT CHAR(0xDF USING latin1) AS c;
SHOW CREATE VIEW v1;
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select char(0xdf using latin1) AS `c` utf8 utf8_general_ci
SELECT * FROM v1;
c
ß
DROP VIEW v1;
#
# End of 10.0 tests
#
#
Expand Down
26 changes: 26 additions & 0 deletions mysql-test/r/ctype_utf8mb4.result
Original file line number Diff line number Diff line change
Expand Up @@ -3421,6 +3421,32 @@ a b
a 😁 b a ? b
DROP TABLE t1;
#
# MDEV-8949: COLUMN_CREATE unicode name breakage
#
SET NAMES utf8mb4;
SELECT COLUMN_JSON(COLUMN_CREATE(_utf8mb4 0xF09F988E, 1));
COLUMN_JSON(COLUMN_CREATE(_utf8mb4 0xF09F988E, 1))
{"😎":1}
SELECT COLUMN_LIST(COLUMN_CREATE(_utf8mb4 0xF09F988E, 1));
COLUMN_LIST(COLUMN_CREATE(_utf8mb4 0xF09F988E, 1))
`😎`
SELECT COLUMN_GET(COLUMN_CREATE(_utf8mb4 0xF09F988E, 1), _utf8mb4 0xF09F988E
as int);
COLUMN_GET(COLUMN_CREATE(_utf8mb4 0xF09F988E, 1), _utf8mb4 0xF09F988E
as int)
1
CREATE TABLE t1 AS SELECT
COLUMN_LIST(COLUMN_CREATE('a',1)),
COLUMN_JSON(COLUMN_CREATE('b',1));
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`COLUMN_LIST(COLUMN_CREATE('a',1))` longtext CHARACTER SET utf8mb4,
`COLUMN_JSON(COLUMN_CREATE('b',1))` longtext CHARACTER SET utf8mb4
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
SET NAMES default;
#
# End of 10.0 tests
#
#
Expand Down
21 changes: 21 additions & 0 deletions mysql-test/r/func_str.result
Original file line number Diff line number Diff line change
Expand Up @@ -4547,6 +4547,27 @@ set global max_allowed_packet=default;
# End of 5.6 tests
#
#
# Start of 10.0 tests
#
#
# MDEV-12681 Wrong VIEW results for CHAR(0xDF USING latin1)
#
EXPLAIN EXTENDED SELECT CHAR(0xDF USING latin1);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
Note 1003 select char(0xdf using latin1) AS `CHAR(0xDF USING latin1)`
EXPLAIN EXTENDED SELECT CHAR(0xDF USING `binary`);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
Note 1003 select char(0xdf) AS `CHAR(0xDF USING ``binary``)`
EXPLAIN EXTENDED SELECT CHAR(0xDF);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
Note 1003 select char(0xdf) AS `CHAR(0xDF)`
#
# Start of 10.1 tests
#
#
Expand Down
12 changes: 12 additions & 0 deletions mysql-test/t/ctype_utf8.test
Original file line number Diff line number Diff line change
Expand Up @@ -1869,6 +1869,18 @@ SELECT _utf8 0x7E, _utf8 X'7E', _utf8 B'01111110';
let $ctype_unescape_combinations=selected;
--source include/ctype_unescape.inc

--echo #
--echo # MDEV-12681 Wrong VIEW results for CHAR(0xDF USING latin1)
--echo #

SET NAMES utf8;
SELECT CHAR(0xDF USING latin1);
CREATE OR REPLACE VIEW v1 AS SELECT CHAR(0xDF USING latin1) AS c;
SHOW CREATE VIEW v1;
SELECT * FROM v1;
DROP VIEW v1;


--echo #
--echo # End of 10.0 tests
--echo #
Expand Down
18 changes: 18 additions & 0 deletions mysql-test/t/ctype_utf8mb4.test
Original file line number Diff line number Diff line change
Expand Up @@ -1913,6 +1913,24 @@ INSERT INTO t1 SELECT 'a 😁 b', 'a 😁 b';
SELECT * FROM t1;
DROP TABLE t1;

--echo #
--echo # MDEV-8949: COLUMN_CREATE unicode name breakage
--echo #

SET NAMES utf8mb4;
SELECT COLUMN_JSON(COLUMN_CREATE(_utf8mb4 0xF09F988E, 1));
SELECT COLUMN_LIST(COLUMN_CREATE(_utf8mb4 0xF09F988E, 1));
SELECT COLUMN_GET(COLUMN_CREATE(_utf8mb4 0xF09F988E, 1), _utf8mb4 0xF09F988E
as int);

CREATE TABLE t1 AS SELECT
COLUMN_LIST(COLUMN_CREATE('a',1)),
COLUMN_JSON(COLUMN_CREATE('b',1));
SHOW CREATE TABLE t1;
DROP TABLE t1;

SET NAMES default;

--echo #
--echo # End of 10.0 tests
--echo #
Expand Down
13 changes: 12 additions & 1 deletion mysql-test/t/func_str.test
Original file line number Diff line number Diff line change
Expand Up @@ -1756,6 +1756,18 @@ set global max_allowed_packet=default;
--echo # End of 5.6 tests
--echo #

--echo #
--echo # Start of 10.0 tests
--echo #

--echo #
--echo # MDEV-12681 Wrong VIEW results for CHAR(0xDF USING latin1)
--echo #

EXPLAIN EXTENDED SELECT CHAR(0xDF USING latin1);
EXPLAIN EXTENDED SELECT CHAR(0xDF USING `binary`);
EXPLAIN EXTENDED SELECT CHAR(0xDF);

--echo #
--echo # Start of 10.1 tests
--echo #
Expand Down Expand Up @@ -1800,7 +1812,6 @@ SELECT f1,HEX(f2) FROM t1 WHERE f1='YQ==' AND (f2= from_base64(
SELECT f1,HEX(f2) FROM t1 WHERE f1='YQ==' AND (f2= from_base64("Yq==") OR f2= from_base64("YQ=="));
DROP TABLE t1;


--echo #
--echo # End of 10.1 tests
--echo #
3 changes: 1 addition & 2 deletions mysys/ma_dyncol.c
Original file line number Diff line number Diff line change
Expand Up @@ -4183,8 +4183,7 @@ mariadb_dyncol_json_internal(DYNAMIC_COLUMN *str, DYNAMIC_STRING *json,
}
else
{
if ((rc= mariadb_dyncol_val_str(json, &val,
&my_charset_utf8_general_ci, '"')) < 0)
if ((rc= mariadb_dyncol_val_str(json, &val, DYNCOL_UTF, '"')) < 0)
goto err;
}
}
Expand Down
6 changes: 3 additions & 3 deletions sql/item_cmpfunc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6890,7 +6890,7 @@ longlong Item_func_dyncol_exists::val_int()
null_value= 1;
return 1;
}
if (my_charset_same(nm->charset(), &my_charset_utf8_general_ci))
if (my_charset_same(nm->charset(), DYNCOL_UTF))
{
buf.str= (char *) nm->ptr();
buf.length= nm->length();
Expand All @@ -6900,11 +6900,11 @@ longlong Item_func_dyncol_exists::val_int()
uint strlen;
uint dummy_errors;
buf.str= (char *)sql_alloc((strlen= nm->length() *
my_charset_utf8_general_ci.mbmaxlen + 1));
DYNCOL_UTF->mbmaxlen + 1));
if (buf.str)
{
buf.length=
copy_and_convert(buf.str, strlen, &my_charset_utf8_general_ci,
copy_and_convert(buf.str, strlen, DYNCOL_UTF,
nm->ptr(), nm->length(), nm->charset(),
&dummy_errors);
}
Expand Down
31 changes: 23 additions & 8 deletions sql/item_strfunc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2849,6 +2849,20 @@ String *Item_func_make_set::val_str(String *str)
}


void Item_func_char::print(String *str, enum_query_type query_type)
{
str->append(Item_func_char::func_name());
str->append('(');
print_args(str, 0, query_type);
if (collation.collation != &my_charset_bin)
{
str->append(C_STRING_WITH_LEN(" using "));
str->append(collation.collation->csname);
}
str->append(')');
}


String *Item_func_char::val_str(String *str)
{
DBUG_ASSERT(fixed == 1);
Expand Down Expand Up @@ -4414,7 +4428,7 @@ bool Item_func_dyncol_create::prepare_arguments(bool force_names_arg)
if (res)
{
// guaranty UTF-8 string for names
if (my_charset_same(res->charset(), &my_charset_utf8_general_ci))
if (my_charset_same(res->charset(), DYNCOL_UTF))
{
keys_str[i].length= res->length();
keys_str[i].str= sql_strmake(res->ptr(), res->length());
Expand All @@ -4425,11 +4439,11 @@ bool Item_func_dyncol_create::prepare_arguments(bool force_names_arg)
uint dummy_errors;
char *str=
(char *)sql_alloc((strlen= res->length() *
my_charset_utf8_general_ci.mbmaxlen + 1));
DYNCOL_UTF->mbmaxlen + 1));
if (str)
{
keys_str[i].length=
copy_and_convert(str, strlen, &my_charset_utf8_general_ci,
copy_and_convert(str, strlen, DYNCOL_UTF,
res->ptr(), res->length(), res->charset(),
&dummy_errors);
keys_str[i].str= str;
Expand Down Expand Up @@ -4648,9 +4662,10 @@ String *Item_func_dyncol_json::val_str(String *str)
char *ptr;
size_t length, alloc_length;
dynstr_reassociate(&json, &ptr, &length, &alloc_length);
str->reset(ptr, length, alloc_length, &my_charset_utf8_general_ci);
str->reset(ptr, length, alloc_length, DYNCOL_UTF);
null_value= FALSE;
}
str->set_charset(DYNCOL_UTF);
return str;

null:
Expand Down Expand Up @@ -4748,7 +4763,7 @@ bool Item_dyncol_get::get_dyn_value(DYNAMIC_COLUMN_VALUE *val, String *tmp)
return 1;
}

if (my_charset_same(nm->charset(), &my_charset_utf8_general_ci))
if (my_charset_same(nm->charset(), DYNCOL_UTF))
{
buf.str= (char *) nm->ptr();
buf.length= nm->length();
Expand All @@ -4758,11 +4773,11 @@ bool Item_dyncol_get::get_dyn_value(DYNAMIC_COLUMN_VALUE *val, String *tmp)
uint strlen;
uint dummy_errors;
buf.str= (char *)sql_alloc((strlen= nm->length() *
my_charset_utf8_general_ci.mbmaxlen + 1));
DYNCOL_UTF->mbmaxlen + 1));
if (buf.str)
{
buf.length=
copy_and_convert(buf.str, strlen, &my_charset_utf8_general_ci,
copy_and_convert(buf.str, strlen, DYNCOL_UTF,
nm->ptr(), nm->length(), nm->charset(),
&dummy_errors);
}
Expand Down Expand Up @@ -5201,7 +5216,6 @@ String *Item_func_dyncol_list::val_str(String *str)
goto null;

str->length(0);
str->set_charset(&my_charset_utf8_general_ci);
for (i= 0; i < count; i++)
{
append_identifier(current_thd, str, names[i].str, names[i].length);
Expand All @@ -5211,6 +5225,7 @@ String *Item_func_dyncol_list::val_str(String *str)
null_value= FALSE;
if (names)
my_free(names);
str->set_charset(DYNCOL_UTF);
return str;

null:
Expand Down
8 changes: 5 additions & 3 deletions sql/item_strfunc.h
Original file line number Diff line number Diff line change
Expand Up @@ -784,6 +784,7 @@ class Item_func_char :public Item_str_func
max_length= arg_count * 4;
}
const char *func_name() const { return "char"; }
void print(String *str, enum_query_type query_type);
};


Expand Down Expand Up @@ -1283,14 +1284,14 @@ class Item_func_dyncol_add: public Item_func_dyncol_create
class Item_func_dyncol_json: public Item_str_func
{
public:
Item_func_dyncol_json(THD *thd, Item *str): Item_str_func(thd, str) {}
Item_func_dyncol_json(THD *thd, Item *str): Item_str_func(thd, str)
{collation.set(DYNCOL_UTF);}
const char *func_name() const{ return "column_json"; }
String *val_str(String *);
void fix_length_and_dec()
{
max_length= MAX_BLOB_WIDTH;
maybe_null= 1;
collation.set(&my_charset_bin);
decimals= 0;
}
};
Expand Down Expand Up @@ -1323,7 +1324,8 @@ class Item_dyncol_get: public Item_str_func
class Item_func_dyncol_list: public Item_str_func
{
public:
Item_func_dyncol_list(THD *thd, Item *str): Item_str_func(thd, str) {};
Item_func_dyncol_list(THD *thd, Item *str): Item_str_func(thd, str)
{collation.set(DYNCOL_UTF);}
void fix_length_and_dec() { maybe_null= 1; max_length= MAX_BLOB_WIDTH; };
const char *func_name() const{ return "column_list"; }
String *val_str(String *);
Expand Down
3 changes: 0 additions & 3 deletions storage/innobase/include/que0que.h
Original file line number Diff line number Diff line change
Expand Up @@ -383,9 +383,6 @@ struct que_thr_t{
UT_LIST_NODE_T(que_thr_t)
thrs; /*!< list of thread nodes of the fork
node */
UT_LIST_NODE_T(que_thr_t)
trx_thrs; /*!< lists of threads in wait list of
the trx */
UT_LIST_NODE_T(que_thr_t)
queue; /*!< list of runnable thread nodes in
the server task queue */
Expand Down
1 change: 0 additions & 1 deletion storage/maria/ma_loghandler.c
Original file line number Diff line number Diff line change
Expand Up @@ -6342,7 +6342,6 @@ my_bool translog_write_record(LSN *lsn,
short_trid, &parts, trn, hook_arg);
break;
case LOGRECTYPE_NOT_ALLOWED:
DBUG_ASSERT(0);
default:
DBUG_ASSERT(0);
rc= 1;
Expand Down
3 changes: 0 additions & 3 deletions storage/xtradb/include/que0que.h
Original file line number Diff line number Diff line change
Expand Up @@ -384,9 +384,6 @@ struct que_thr_t{
UT_LIST_NODE_T(que_thr_t)
thrs; /*!< list of thread nodes of the fork
node */
UT_LIST_NODE_T(que_thr_t)
trx_thrs; /*!< lists of threads in wait list of
the trx */
UT_LIST_NODE_T(que_thr_t)
queue; /*!< list of runnable thread nodes in
the server task queue */
Expand Down

0 comments on commit ce07d09

Please sign in to comment.