Skip to content

Commit 0ca0866

Browse files
committed
Merge branch 'mysql-5.7' of myrepo.no.oracle.com:mysql into mysql-5.7
2 parents f6ae349 + 9bc2777 commit 0ca0866

Some content is hidden

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

46 files changed

+877
-286
lines changed

client/mysqladmin.cc

-4
Original file line numberDiff line numberDiff line change
@@ -306,9 +306,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
306306
error++;
307307
break;
308308
case OPT_CHARSETS_DIR:
309-
#if MYSQL_VERSION_ID > 32300
310309
charsets_dir = argument;
311-
#endif
312310
break;
313311
case OPT_MYSQL_PROTOCOL:
314312
opt_protocol= find_type_or_exit(argument, &sql_protocol_typelib,
@@ -1286,11 +1284,9 @@ static void usage(void)
12861284
flush-threads Flush the thread cache\n\
12871285
flush-privileges Reload grant tables (same as reload)\n\
12881286
kill id,id,... Kill mysql threads");
1289-
#if MYSQL_VERSION_ID >= 32200
12901287
puts("\
12911288
password [new-password] Change old password to new-password in current format\n\
12921289
old-password [new-password] Change old password to new-password in old format");
1293-
#endif
12941290
puts("\
12951291
ping Check if mysqld is alive\n\
12961292
processlist Show list of active threads in server\n\

client/mysqldump.c

+1-3
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ static struct my_option my_long_options[] =
284284
{"debug-check", OPT_DEBUG_CHECK, "This is a non-debug version. Catch this and exit.",
285285
0, 0, 0,
286286
GET_DISABLED, NO_ARG, 0, 0, 0, 0, 0, 0},
287-
{"debug-info", 'T', "This is a non-debug version. Catch this and exit.", 0,
287+
{"debug-info", OPT_DEBUG_INFO, "This is a non-debug version. Catch this and exit.", 0,
288288
0, 0, GET_DISABLED, NO_ARG, 0, 0, 0, 0, 0, 0},
289289
#else
290290
{"debug", '#', "Output debug log.", &default_dbug_option,
@@ -1719,11 +1719,9 @@ static void unescape(FILE *file,char *pos,uint length)
17191719

17201720
static my_bool test_if_special_chars(const char *str)
17211721
{
1722-
#if MYSQL_VERSION_ID >= 32300
17231722
for ( ; *str ; str++)
17241723
if (!my_isvar(charset_info,*str) && *str != '$')
17251724
return 1;
1726-
#endif
17271725
return 0;
17281726
} /* test_if_special_chars */
17291727

client/mysqltest.cc

-6
Original file line numberDiff line numberDiff line change
@@ -5399,11 +5399,7 @@ void set_reconnect(MYSQL* mysql, int val)
53995399
my_bool reconnect= val;
54005400
DBUG_ENTER("set_reconnect");
54015401
DBUG_PRINT("info", ("val: %d", val));
5402-
#if MYSQL_VERSION_ID < 50000
5403-
mysql->reconnect= reconnect;
5404-
#else
54055402
mysql_options(mysql, MYSQL_OPT_RECONNECT, (char *)&reconnect);
5406-
#endif
54075403
DBUG_VOID_RETURN;
54085404
}
54095405

@@ -8111,7 +8107,6 @@ void run_query_stmt(MYSQL *mysql, struct st_command *command,
81118107
parameter markers.
81128108
*/
81138109

8114-
#if MYSQL_VERSION_ID >= 50000
81158110
if (cursor_protocol_enabled)
81168111
{
81178112
/*
@@ -8122,7 +8117,6 @@ void run_query_stmt(MYSQL *mysql, struct st_command *command,
81228117
die("mysql_stmt_attr_set(STMT_ATTR_CURSOR_TYPE) failed': %d %s",
81238118
mysql_stmt_errno(stmt), mysql_stmt_error(stmt));
81248119
}
8125-
#endif
81268120

81278121
/*
81288122
Execute the query

client/upgrade/program.cc

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#include "mysqld_error.h"
2727
#include "my_default.h"
2828
#include "check/mysqlcheck.h"
29+
#include "mysql_version.h"
2930
#include "../scripts/mysql_fix_privilege_tables_sql.c"
3031
#include "../scripts/sql_commands_sys_schema.h"
3132

include/mysql/plugin.h

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
#ifndef MYSQL_ABI_CHECK
2020
#include <stddef.h>
21+
#include "mysql_version.h" /* MYSQL_VERSION_ID */
2122
#endif
2223

2324
/*

include/mysql_com.h

-2
Original file line numberDiff line numberDiff line change
@@ -455,9 +455,7 @@ enum mysql_enum_shutdown_level {
455455
/* don't flush InnoDB buffers, flush other storage engines' buffers*/
456456
SHUTDOWN_WAIT_CRITICAL_BUFFERS= (MYSQL_SHUTDOWN_KILLABLE_UPDATE << 1) + 1,
457457
/* Now the 2 levels of the KILL command */
458-
#if MYSQL_VERSION_ID >= 50000
459458
KILL_QUERY= 254,
460-
#endif
461459
KILL_CONNECTION= 255
462460
};
463461

mysql-test/mysql-test-run.pl

+7
Original file line numberDiff line numberDiff line change
@@ -3801,6 +3801,13 @@ sub mysql_install_db {
38013801
"Could not install system database from $bootstrap_sql_file\n" .
38023802
"see $path_bootstrap_log for errors");
38033803
}
3804+
3805+
# Remove the auto.cnf so that a new auto.cnf is generated
3806+
# for master and slaves when the server is restarted
3807+
if (-f "$datadir/auto.cnf")
3808+
{
3809+
unlink "$datadir/auto.cnf";
3810+
}
38043811
}
38053812

38063813

mysql-test/r/gis-precise.result

+10
Original file line numberDiff line numberDiff line change
@@ -2058,6 +2058,16 @@ select ST_ASTEXT(ST_UNION(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(MULTILINESTRING((0
20582058
ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(POINT(7 0),MULTILINESTRING((-13 -18,-16 0),(17 11,-1 11,-18 -19,-4 -18),(-8 -8,-15 -13,3 -18,6 8)),LINESTRING(5 16,0 -9,-6 4,-15 17),MULTIPOINT(-9 -5,5 15,12 -11,12 11))'))) as result;
20592059
result
20602060
GEOMETRYCOLLECTION(MULTIPOINT(0 14,-9 -11),MULTIPOINT(16 1,-9 -17,-16 6,-17 3),POINT(-9 -5),POINT(5 15),POINT(12 -11),MULTILINESTRING((0 -14,13 -8),(-5 -3,8 7),(-6 18,17 -11,-12 19,19 5),(16 11,9 -5),(17 -5,5 10),(-4 17,6 4),(-12 15,17 13,-18 11,15 10),(7 0,2 -16,-18 13,-6 4),(-17 -6,-6 -7,1 4,-18 0),(-11 -2,17 -14),(18 -12,18 -8),(-13 -16,9 16,9 -10,-7 20),(-14 -5,10 -9,4 1,17 -8),(-9 -4,-2 -12,9 -13,-5 4),(15 17,13 20),(5 16,0 -9,-6 4,-15 17),(-13 -18,-16 0),(17 11,-1 11,-18 -19,-4 -18),(-8 -8,-15 -13,3 -18,6 8)))
2061+
#
2062+
# Bug#21127270 CAN NOT CREATE EMPTY GEOMETRY WITH GEOMETRYCOLLECTION()
2063+
#
2064+
select st_astext(geometrycollection()) as result;
2065+
result
2066+
GEOMETRYCOLLECTION()
2067+
set @empty_geom = geometrycollection();
2068+
select 1, @empty_geom = st_geomfromtext('geometrycollection()') as equal;
2069+
1 equal
2070+
1 1
20612071
DROP TABLE IF EXISTS p1;
20622072
CREATE PROCEDURE p1(dist DOUBLE, geom TEXT)
20632073
BEGIN

mysql-test/r/type_enum.result

+1
Original file line numberDiff line numberDiff line change
@@ -1836,6 +1836,7 @@ CREATE TABLE t1(a enum('a','b','c','d'));
18361836
INSERT INTO t1 VALUES (4),(1),(0),(3);
18371837
Warnings:
18381838
Warning 1265 Data truncated for column 'a' at row 3
1839+
ANALYZE TABLE t1;
18391840
SELECT a FROM t1;
18401841
a
18411842
d

mysql-test/r/type_newdecimal.result

+3
Original file line numberDiff line numberDiff line change
@@ -2130,3 +2130,6 @@ SELECT * FROM t1 WHERE value = '100000000000000000000002';
21302130
value
21312131
100000000000000000000002
21322132
DROP TABLE t1;
2133+
SELECT CAST(-0.0e0 AS DECIMAL) = 0;
2134+
CAST(-0.0e0 AS DECIMAL) = 0
2135+
1

mysql-test/suite/binlog/r/binlog_error_action.result

+16
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ call mtr.add_suppression("Could not open .*");
66
call mtr.add_suppression("Could not use .*");
77
call mtr.add_suppression("Can't generate a unique log-filename master-bin");
88
call mtr.add_suppression("The server was unable to create a new log file *");
9+
call mtr.add_suppression("An error occured during flushing cache to file.");
10+
call mtr.add_suppression("Either disk is full or file system is read only");
911
RESET MASTER;
1012
Test case1
1113
SET GLOBAL binlog_error_action= ABORT_SERVER;
@@ -67,5 +69,19 @@ t2
6769
DROP TABLE t2;
6870
SET SESSION debug="-d,fault_injection_init_name";
6971
# restart
72+
Test case9
73+
CREATE TABLE t1(i INT);
74+
SET SESSION debug="+d,simulate_error_during_flush_cache_to_file";
75+
SET GLOBAL binlog_error_action= ABORT_SERVER;
76+
INSERT INTO t1 VALUES (1);
77+
ERROR HY000: Binary logging not possible. Message: An error occured during flushing cache to file. 'binlog_error_action' is set to 'ABORT_SERVER'. Hence aborting the server
78+
include/assert.inc [Count of elements in t1 should be 0.]
79+
SET SESSION debug="+d,simulate_error_during_flush_cache_to_file";
80+
SET GLOBAL binlog_error_action= IGNORE_ERROR;
81+
INSERT INTO t1 VALUES (2);
82+
include/assert.inc [Count of elements in t1 should be 1.]
83+
DROP table t1;
84+
SET SESSION debug="-d,simulate_error_during_flush_cache_to_file";
85+
# restart
7086
SET SESSION debug="";
7187
SET GLOBAL binlog_error_action= ABORT_SERVER;

mysql-test/suite/binlog/r/binlog_xa_handling.result

+2
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,12 @@ XA END'';
88
XA PREPARE'';
99
XA COMMIT'';
1010
DROP TABLE t1;
11+
RESET MASTER;
1112
CREATE TABLE t1 (c1 INT);
1213
XA BEGIN 'xa1';
1314
INSERT INTO t1 VALUES (1);
1415
XA END 'xa1';
1516
XA COMMIT 'xa1' ONE PHASE;
1617
[Validate that SHOW BINLOG EVENTS shows the ONE PHASE statement.]
1718
DROP TABLE t1;
19+
RESET MASTER;

mysql-test/suite/binlog/t/binlog_error_action.test

+31-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ call mtr.add_suppression("Could not open .*");
3333
call mtr.add_suppression("Could not use .*");
3434
call mtr.add_suppression("Can't generate a unique log-filename master-bin");
3535
call mtr.add_suppression("The server was unable to create a new log file *");
36-
36+
call mtr.add_suppression("An error occured during flushing cache to file.");
37+
call mtr.add_suppression("Either disk is full or file system is read only");
3738
let $old=`select @@debug`;
3839

3940
--let $saved_binlog_error_action=`SELECT @@GLOBAL.binlog_error_action`
@@ -141,6 +142,35 @@ DROP TABLE t2;
141142
SET SESSION debug="-d,fault_injection_init_name";
142143
--source include/restart_mysqld.inc
143144

145+
--echo Test case9
146+
CREATE TABLE t1(i INT);
147+
# Simulate error during flushing cache to file and test the behaviour
148+
# when binlog_error_action is set to ABORT_SERVER/IGNORE_ERROR.
149+
SET SESSION debug="+d,simulate_error_during_flush_cache_to_file";
150+
SET GLOBAL binlog_error_action= ABORT_SERVER;
151+
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
152+
--error ER_BINLOG_LOGGING_IMPOSSIBLE
153+
INSERT INTO t1 VALUES (1);
154+
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
155+
--enable_reconnect
156+
--source include/wait_until_connected_again.inc
157+
158+
--let $assert_cond= COUNT(*) = 0 FROM t1;
159+
--let $assert_text= Count of elements in t1 should be 0.
160+
--source include/assert.inc
161+
162+
SET SESSION debug="+d,simulate_error_during_flush_cache_to_file";
163+
SET GLOBAL binlog_error_action= IGNORE_ERROR;
164+
INSERT INTO t1 VALUES (2);
165+
166+
--let $assert_cond= COUNT(*) = 1 FROM t1;
167+
--let $assert_text= Count of elements in t1 should be 1.
168+
--source include/assert.inc
169+
170+
DROP table t1;
171+
SET SESSION debug="-d,simulate_error_during_flush_cache_to_file";
172+
--source include/restart_mysqld.inc
173+
144174
# Cleanup
145175
eval SET SESSION debug="$old";
146176
--eval SET GLOBAL binlog_error_action= $saved_binlog_error_action

mysql-test/suite/binlog/t/binlog_xa_handling.test

+9
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ DROP TABLE t1;
3737
# mysql-test/extra/binlog_tests/binlog_xa_prepared.test
3838
#
3939

40+
# clean up binary log so that the following operation
41+
# does not have to scan through a long history of
42+
# events in the log (potentially causing a failure).
43+
RESET MASTER;
44+
4045
CREATE TABLE t1 (c1 INT);
4146
XA BEGIN 'xa1';
4247
INSERT INTO t1 VALUES (1);
@@ -48,3 +53,7 @@ XA COMMIT 'xa1' ONE PHASE;
4853
--source include/wait_for_binlog_event.inc
4954

5055
DROP TABLE t1;
56+
57+
# clean up the binary log at in the end of the test
58+
# case as well.
59+
RESET MASTER;

mysql-test/suite/gcol/inc/gcol_column_def_options.inc

+13
Original file line numberDiff line numberDiff line change
@@ -231,3 +231,16 @@ CREATE TABLE t1 (c1 INT, c2 INT AS (c1 * 2)) SELECT 1 AS c1, a AS c2 from t2;
231231
CREATE TABLE t1 (c1 INT, c2 INT AS (c1 * 2)) SELECT 1 AS c1, 5;
232232
SELECT * FROM t1;
233233
DROP TABLE t1, t2;
234+
235+
--echo # Bug#20757211: GENERATED COLUMNS: ALTER TABLE CRASHES
236+
--echo # IN FIND_FIELD_IN_TABLE
237+
--echo #
238+
CREATE TABLE t1(a int);
239+
--error 1064
240+
ALTER TABLE t1 ADD COLUMN z int GENERATED ALWAYS AS
241+
( 1 NOT IN (SELECT 1 FROM t1 WHERE c0006) ) virtual;
242+
--error 1064
243+
CREATE TABLE t2(a int, b int as (1 NOT IN (SELECT 1 FROM t1 WHERE not_exist_col)));
244+
--error 1064
245+
CREATE TABLE t2(a int, b int as (1 NOT IN (SELECT 1 FROM dual)));
246+
DROP TABLE t1;

mysql-test/suite/gcol/inc/gcol_ins_upd.inc

+48
Original file line numberDiff line numberDiff line change
@@ -314,3 +314,51 @@ UPDATE t1 SET col7 = DEFAULT;
314314
UPDATE t1 SET col8 = DEFAULT;
315315
DROP TABLE t1;
316316

317+
--echo # Bug#21081742: ASSERTION !TABLE || (!TABLE->WRITE_SET ||
318+
--echo # BITMAP_IS_SET(TABLE->WRITE_SET
319+
--echo #
320+
321+
CREATE TABLE b (
322+
pk INTEGER AUTO_INCREMENT,
323+
col_varchar_nokey VARCHAR(1),
324+
col_varchar_key VARCHAR(2) GENERATED ALWAYS AS
325+
(CONCAT(col_varchar_nokey, col_varchar_nokey)),
326+
PRIMARY KEY (pk)
327+
);
328+
329+
INSERT INTO b (col_varchar_nokey) VALUES ('v'),('v');
330+
331+
CREATE TABLE d (
332+
pk INTEGER AUTO_INCREMENT,
333+
col_varchar_nokey VARCHAR(1),
334+
col_varchar_key VARCHAR(2) GENERATED ALWAYS AS
335+
(CONCAT(col_varchar_nokey, col_varchar_nokey)),
336+
PRIMARY KEY (pk)
337+
) ;
338+
339+
INSERT INTO d (col_varchar_nokey) VALUES ('q'),('g'),('e'),('l'),(NULL),('v'),('c'),('u'),('x');
340+
341+
CREATE TABLE bb (
342+
pk INTEGER AUTO_INCREMENT,
343+
col_varchar_nokey VARCHAR(1) /*! NULL */,
344+
col_varchar_key VARCHAR(2) GENERATED ALWAYS AS
345+
(CONCAT(col_varchar_nokey, col_varchar_nokey)),
346+
PRIMARY KEY (pk)
347+
);
348+
349+
INSERT INTO bb (col_varchar_nokey) VALUES ('j'),('h');
350+
351+
EXPLAIN UPDATE
352+
d AS OUTR1, b AS OUTR2
353+
SET OUTR1.col_varchar_nokey = NULL
354+
WHERE
355+
( 't', 'b' ) IN
356+
(
357+
SELECT
358+
INNR1.col_varchar_nokey AS x,
359+
INNR1.col_varchar_key AS y
360+
FROM bb AS INNR1
361+
WHERE OUTR1.pk = 1
362+
);
363+
364+
DROP TABLE IF EXISTS b,bb,d;

mysql-test/suite/gcol/r/gcol_column_def_options_innodb.result

+12
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,18 @@ SELECT * FROM t1;
361361
c2 c1 5
362362
2 1 5
363363
DROP TABLE t1, t2;
364+
# Bug#20757211: GENERATED COLUMNS: ALTER TABLE CRASHES
365+
# IN FIND_FIELD_IN_TABLE
366+
#
367+
CREATE TABLE t1(a int);
368+
ALTER TABLE t1 ADD COLUMN z int GENERATED ALWAYS AS
369+
( 1 NOT IN (SELECT 1 FROM t1 WHERE c0006) ) virtual;
370+
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT 1 FROM t1 WHERE c0006))' at line 1
371+
CREATE TABLE t2(a int, b int as (1 NOT IN (SELECT 1 FROM t1 WHERE not_exist_col)));
372+
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT 1 FROM t1 WHERE not_exist_col))' at line 1
373+
CREATE TABLE t2(a int, b int as (1 NOT IN (SELECT 1 FROM dual)));
374+
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT 1 FROM dual))' at line 1
375+
DROP TABLE t1;
364376
DROP VIEW IF EXISTS v1,v2;
365377
DROP TABLE IF EXISTS t1,t2,t3;
366378
DROP PROCEDURE IF EXISTS p1;

mysql-test/suite/gcol/r/gcol_column_def_options_myisam.result

+12
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,18 @@ SELECT * FROM t1;
361361
c2 c1 5
362362
2 1 5
363363
DROP TABLE t1, t2;
364+
# Bug#20757211: GENERATED COLUMNS: ALTER TABLE CRASHES
365+
# IN FIND_FIELD_IN_TABLE
366+
#
367+
CREATE TABLE t1(a int);
368+
ALTER TABLE t1 ADD COLUMN z int GENERATED ALWAYS AS
369+
( 1 NOT IN (SELECT 1 FROM t1 WHERE c0006) ) virtual;
370+
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT 1 FROM t1 WHERE c0006))' at line 1
371+
CREATE TABLE t2(a int, b int as (1 NOT IN (SELECT 1 FROM t1 WHERE not_exist_col)));
372+
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT 1 FROM t1 WHERE not_exist_col))' at line 1
373+
CREATE TABLE t2(a int, b int as (1 NOT IN (SELECT 1 FROM dual)));
374+
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT 1 FROM dual))' at line 1
375+
DROP TABLE t1;
364376
DROP VIEW IF EXISTS v1,v2;
365377
DROP TABLE IF EXISTS t1,t2,t3;
366378
DROP PROCEDURE IF EXISTS p1;

0 commit comments

Comments
 (0)