Skip to content

Commit 638afc4

Browse files
committed
Merge 10.6 into 10.7
2 parents ee5966c + 2c00526 commit 638afc4

File tree

274 files changed

+9339
-8443
lines changed

Some content is hidden

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

274 files changed

+9339
-8443
lines changed

CMakeLists.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -421,14 +421,12 @@ IF(WITH_UNIT_TESTS)
421421
ENDIF()
422422
ENDIF()
423423

424-
INCLUDE(cpack_tgz)
425-
INCLUDE(cpack_rpm)
426-
INCLUDE(cpack_deb)
427424

428425
UNSET (MYSQLD_STATIC_PLUGIN_LIBS CACHE)
429426

430427
INCLUDE(mariadb_connector_c) # this does ADD_SUBDIRECTORY(libmariadb)
431428

429+
INCLUDE(cpack_tgz)
432430
INCLUDE(cpack_rpm)
433431
INCLUDE(cpack_deb)
434432

extra/mariabackup/backup_copy.cc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ Street, Fifth Floor, Boston, MA 02110-1335 USA
5555
#include "xtrabackup.h"
5656
#include "common.h"
5757
#include "backup_copy.h"
58+
#include "backup_debug.h"
5859
#include "backup_mysql.h"
5960
#include <btr0btr.h>
6061

@@ -1443,6 +1444,13 @@ bool backup_start(CorruptedPages &corrupted_pages)
14431444

14441445
msg("Waiting for log copy thread to read lsn %llu", (ulonglong)server_lsn_after_lock);
14451446
backup_wait_for_lsn(server_lsn_after_lock);
1447+
DBUG_EXECUTE_FOR_KEY("sleep_after_waiting_for_lsn", {},
1448+
{
1449+
ulong milliseconds = strtoul(dbug_val, NULL, 10);
1450+
msg("sleep_after_waiting_for_lsn");
1451+
my_sleep(milliseconds*1000UL);
1452+
});
1453+
14461454
backup_fix_ddl(corrupted_pages);
14471455

14481456
// There is no need to stop slave thread before coping non-Innodb data when

extra/mariabackup/xtrabackup.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3099,7 +3099,7 @@ static void log_copying_thread()
30993099
(!metadata_to_lsn || metadata_to_lsn > log_copy_scanned_lsn))
31003100
{
31013101
timespec abstime;
3102-
set_timespec_nsec(abstime, 1000ULL * xtrabackup_log_copy_interval);
3102+
set_timespec_nsec(abstime, 1000000ULL * xtrabackup_log_copy_interval);
31033103
mysql_cond_timedwait(&log_copying_stop, &log_sys.mutex, &abstime);
31043104
}
31053105
log_copying_running= false;
@@ -6779,7 +6779,7 @@ int main(int argc, char **argv)
67796779
key_map_full.set_all();
67806780

67816781
logger.init_base();
6782-
logger.set_handlers(LOG_FILE, LOG_NONE, LOG_NONE);
6782+
logger.set_handlers(LOG_NONE, LOG_NONE);
67836783
mysql_mutex_init(key_LOCK_error_log, &LOCK_error_log,
67846784
MY_MUTEX_INIT_FAST);
67856785

extra/wolfssl/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ ${WOLFCRYPT_SRCDIR}/md5.c
9494
${WOLFCRYPT_SRCDIR}/memory.c
9595
${WOLFCRYPT_SRCDIR}/pkcs12.c
9696
${WOLFCRYPT_SRCDIR}/pwdbased.c
97-
${WOLFCRYPT_SRCDIR}/rabbit.c
9897
${WOLFCRYPT_SRCDIR}/random.c
9998
${WOLFCRYPT_SRCDIR}/rsa.c
10099
${WOLFCRYPT_SRCDIR}/sha.c

include/my_compiler.h

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#define MY_COMPILER_INCLUDED
33

44
/* Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
5-
Copyright (c) 2017, 2020, MariaDB Corporation.
5+
Copyright (c) 2017, 2022, MariaDB Corporation.
66
77
This program is free software; you can redistribute it and/or modify
88
it under the terms of the GNU General Public License as published by
@@ -39,15 +39,8 @@
3939

4040
/* GNU C/C++ */
4141
#if defined __GNUC__
42-
/* Convenience macro to test the minimum required GCC version. */
43-
# define MY_GNUC_PREREQ(maj, min) \
44-
((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
45-
/* Any after 2.95... */
4642
# define MY_ALIGN_EXT
47-
/* Comunicate to the compiler the unreachability of the code. */
48-
# if MY_GNUC_PREREQ(4,5)
49-
# define MY_ASSERT_UNREACHABLE() __builtin_unreachable()
50-
# endif
43+
# define MY_ASSERT_UNREACHABLE() __builtin_unreachable()
5144

5245
/* Microsoft Visual C++ */
5346
#elif defined _MSC_VER
@@ -84,10 +77,6 @@
8477
Generic (compiler-independent) features.
8578
*/
8679

87-
#ifndef MY_GNUC_PREREQ
88-
# define MY_GNUC_PREREQ(maj, min) (0)
89-
#endif
90-
9180
#ifndef MY_ALIGNOF
9281
# ifdef __cplusplus
9382
template<typename type> struct my_alignof_helper { char m1; type m2; };
@@ -158,7 +147,6 @@ struct my_aligned_storage
158147
#ifdef __GNUC__
159148
# define ATTRIBUTE_NORETURN __attribute__((noreturn))
160149
# define ATTRIBUTE_NOINLINE __attribute__((noinline))
161-
# if MY_GNUC_PREREQ(4,3)
162150
/** Starting with GCC 4.3, the "cold" attribute is used to inform the
163151
compiler that a function is unlikely executed. The function is
164152
optimized for size rather than speed and on many targets it is placed
@@ -167,8 +155,7 @@ appears close together improving code locality of non-cold parts of
167155
program. The paths leading to call of cold functions within code are
168156
marked as unlikely by the branch prediction mechanism. optimize a
169157
rarely invoked function for size instead for speed. */
170-
# define ATTRIBUTE_COLD __attribute__((cold))
171-
# endif
158+
# define ATTRIBUTE_COLD __attribute__((cold))
172159
#elif defined _MSC_VER
173160
# define ATTRIBUTE_NORETURN __declspec(noreturn)
174161
# define ATTRIBUTE_NOINLINE __declspec(noinline)

include/my_valgrind.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,6 @@
8383
# define MSAN_STAT_WORKAROUND(st) ((void) 0)
8484
#endif /* __has_feature(memory_sanitizer) */
8585

86-
#ifdef HAVE_valgrind
87-
#define IF_VALGRIND(A,B) A
88-
#else
89-
#define IF_VALGRIND(A,B) B
90-
#endif
91-
9286
#ifdef TRASH_FREED_MEMORY
9387
/*
9488
_TRASH_FILL() has to call MEM_MAKE_ADDRESSABLE() to cancel any effect of

mysql-test/main/brackets.result

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4131,7 +4131,7 @@ create view v1 as
41314131
(select * from t2 order by a limit 2) order by b desc;
41324132
show create view v1;
41334133
View Create View character_set_client collation_connection
4134-
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `__3`.`a` AS `a`,`__3`.`b` AS `b` from (select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t2` order by `test`.`t2`.`a` limit 2) `__3` order by `__3`.`b` desc latin1 latin1_swedish_ci
4134+
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `__3`.`a` AS `a`,`__3`.`b` AS `b` from (select `t2`.`a` AS `a`,`t2`.`b` AS `b` from `t2` order by `t2`.`a` limit 2) `__3` order by `__3`.`b` desc latin1 latin1_swedish_ci
41354135
select * from v1;
41364136
a b
41374137
2 20
@@ -4230,7 +4230,7 @@ union
42304230
select a from t1 where a=7;
42314231
show create view v1;
42324232
View Create View character_set_client collation_connection
4233-
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `__5`.`a` AS `a` from (select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` <= 3 except select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` >= 3) `__5` union select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 7 latin1 latin1_swedish_ci
4233+
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `__5`.`a` AS `a` from (select `t1`.`a` AS `a` from `t1` where `t1`.`a` <= 3 except select `t1`.`a` AS `a` from `t1` where `t1`.`a` >= 3) `__5` union select `t1`.`a` AS `a` from `t1` where `t1`.`a` = 7 latin1 latin1_swedish_ci
42344234
select * from v1;
42354235
a
42364236
1
@@ -4257,7 +4257,7 @@ union
42574257
( select a from t1 where a=4 ) ) );
42584258
show create view v1;
42594259
View Create View character_set_client collation_connection
4260-
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 1 union select `__7`.`a` AS `a` from (select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 3 union select `__6`.`a` AS `a` from (select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 2 union (select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 4)) `__6`) `__7` latin1 latin1_swedish_ci
4260+
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a` from `t1` where `t1`.`a` = 1 union select `__7`.`a` AS `a` from (select `t1`.`a` AS `a` from `t1` where `t1`.`a` = 3 union select `__6`.`a` AS `a` from (select `t1`.`a` AS `a` from `t1` where `t1`.`a` = 2 union (select `t1`.`a` AS `a` from `t1` where `t1`.`a` = 4)) `__6`) `__7` latin1 latin1_swedish_ci
42614261
select * from v1;
42624262
a
42634263
1
@@ -4275,7 +4275,7 @@ union
42754275
select a from t1 where a=1;
42764276
show create view v1;
42774277
View Create View character_set_client collation_connection
4278-
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `__7`.`a` AS `a` from (select `__5`.`a` AS `a` from (select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` >= 2 union select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 1 order by `a` desc limit 2) `__5` union select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 3 order by `a` limit 2) `__7` union select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 1 latin1 latin1_swedish_ci
4278+
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `__7`.`a` AS `a` from (select `__5`.`a` AS `a` from (select `t1`.`a` AS `a` from `t1` where `t1`.`a` >= 2 union select `t1`.`a` AS `a` from `t1` where `t1`.`a` = 1 order by `a` desc limit 2) `__5` union select `t1`.`a` AS `a` from `t1` where `t1`.`a` = 3 order by `a` limit 2) `__7` union select `t1`.`a` AS `a` from `t1` where `t1`.`a` = 1 latin1 latin1_swedish_ci
42794279
select * from v1;
42804280
a
42814281
3
@@ -4384,7 +4384,7 @@ union
43844384
select a from t1 where a=2 order by a desc limit 3;
43854385
show create view v1;
43864386
View Create View character_set_client collation_connection
4387-
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `__5`.`a` AS `a` from (select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 1 union values (3),(4),(2) order by 1 desc) `__5` union select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 2 order by `a` desc limit 3 latin1 latin1_swedish_ci
4387+
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `__5`.`a` AS `a` from (select `t1`.`a` AS `a` from `t1` where `t1`.`a` = 1 union values (3),(4),(2) order by 1 desc) `__5` union select `t1`.`a` AS `a` from `t1` where `t1`.`a` = 2 order by `a` desc limit 3 latin1 latin1_swedish_ci
43884388
select * from v1;
43894389
a
43904390
4
@@ -4397,7 +4397,7 @@ with t as (select * from t1 where a <=3)
43974397
select * from t;
43984398
show create view v1;
43994399
View Create View character_set_client collation_connection
4400-
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS with t as (select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` <= 3)select `t`.`a` AS `a` from `t` latin1 latin1_swedish_ci
4400+
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS with t as (select `t1`.`a` AS `a` from `t1` where `t1`.`a` <= 3)select `t`.`a` AS `a` from `t` latin1 latin1_swedish_ci
44014401
select * from v1;
44024402
a
44034403
3
@@ -4413,7 +4413,7 @@ order by a desc limit 3 )
44134413
select a from t1 where a=4 union select a from t where a=7;
44144414
show create view v1;
44154415
View Create View character_set_client collation_connection
4416-
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS with t as (select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` < 3 union select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` > 3 order by `a` desc limit 3)select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 4 union select `t`.`a` AS `a` from `t` where `t`.`a` = 7 latin1 latin1_swedish_ci
4416+
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS with t as (select `t1`.`a` AS `a` from `t1` where `t1`.`a` < 3 union select `t1`.`a` AS `a` from `t1` where `t1`.`a` > 3 order by `a` desc limit 3)select `t1`.`a` AS `a` from `t1` where `t1`.`a` = 4 union select `t`.`a` AS `a` from `t` where `t`.`a` = 7 latin1 latin1_swedish_ci
44174417
select * from v1;
44184418
a
44194419
4
@@ -4429,7 +4429,7 @@ order by a desc limit 3 )
44294429
(select a from t1 where a=4 union select a from t where a=7 order by a desc);
44304430
show create view v1;
44314431
View Create View character_set_client collation_connection
4432-
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS with t as ((select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` < 3) union (select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` > 3) order by `a` desc limit 3)select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 4 union select `t`.`a` AS `a` from `t` where `t`.`a` = 7 order by `a` desc latin1 latin1_swedish_ci
4432+
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS with t as ((select `t1`.`a` AS `a` from `t1` where `t1`.`a` < 3) union (select `t1`.`a` AS `a` from `t1` where `t1`.`a` > 3) order by `a` desc limit 3)select `t1`.`a` AS `a` from `t1` where `t1`.`a` = 4 union select `t`.`a` AS `a` from `t` where `t`.`a` = 7 order by `a` desc latin1 latin1_swedish_ci
44334433
select * from v1;
44344434
a
44354435
7
@@ -4444,7 +4444,7 @@ order by a desc limit 3 )
44444444
(select a from t where a=4 union select a from t where a=7 order by a desc);
44454445
show create view v1;
44464446
View Create View character_set_client collation_connection
4447-
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS with t as ((select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` < 3) union (select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` > 3) order by `a` desc limit 3)select `t`.`a` AS `a` from `t` where `t`.`a` = 4 union select `t`.`a` AS `a` from `t` where `t`.`a` = 7 order by `a` desc latin1 latin1_swedish_ci
4447+
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS with t as ((select `t1`.`a` AS `a` from `t1` where `t1`.`a` < 3) union (select `t1`.`a` AS `a` from `t1` where `t1`.`a` > 3) order by `a` desc limit 3)select `t`.`a` AS `a` from `t` where `t`.`a` = 4 union select `t`.`a` AS `a` from `t` where `t`.`a` = 7 order by `a` desc latin1 latin1_swedish_ci
44484448
select * from v1;
44494449
a
44504450
7
@@ -4469,7 +4469,7 @@ order by 1 desc limit 3 )
44694469
select a from t1 where a=4 union select a from t where a=7 order by a desc;
44704470
show create view v1;
44714471
View Create View character_set_client collation_connection
4472-
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS with t(`a`) as (values (2),(1) union (values (4),(7)) order by 1 desc limit 3)select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 4 union select `t`.`a` AS `a` from `t` where `t`.`a` = 7 order by `a` desc latin1 latin1_swedish_ci
4472+
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS with t(`a`) as (values (2),(1) union (values (4),(7)) order by 1 desc limit 3)select `t1`.`a` AS `a` from `t1` where `t1`.`a` = 4 union select `t`.`a` AS `a` from `t` where `t`.`a` = 7 order by `a` desc latin1 latin1_swedish_ci
44734473
select * from v1;
44744474
a
44754475
7
@@ -4484,7 +4484,7 @@ order by 1 desc limit 3 )
44844484
select a from t1 where a=1 union select a from t where a=7 order by a desc;
44854485
show create view v1;
44864486
View Create View character_set_client collation_connection
4487-
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS with t(`a`) as ((values (2),(1)) union (values (4),(7) order by 1 desc) order by 1 desc limit 3)select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 1 union select `t`.`a` AS `a` from `t` where `t`.`a` = 7 order by `a` desc latin1 latin1_swedish_ci
4487+
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS with t(`a`) as ((values (2),(1)) union (values (4),(7) order by 1 desc) order by 1 desc limit 3)select `t1`.`a` AS `a` from `t1` where `t1`.`a` = 1 union select `t`.`a` AS `a` from `t` where `t`.`a` = 7 order by `a` desc latin1 latin1_swedish_ci
44884488
select * from v1;
44894489
a
44904490
7
@@ -4496,7 +4496,7 @@ s as (select * from t1 where a > 3)
44964496
select a from t where a=1 union select a from s where a=7 order by a desc;
44974497
show create view v1;
44984498
View Create View character_set_client collation_connection
4499-
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS with t as (select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` < 3), s as (select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` > 3)select `t`.`a` AS `a` from `t` where `t`.`a` = 1 union select `s`.`a` AS `a` from `s` where `s`.`a` = 7 order by `a` desc latin1 latin1_swedish_ci
4499+
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS with t as (select `t1`.`a` AS `a` from `t1` where `t1`.`a` < 3), s as (select `t1`.`a` AS `a` from `t1` where `t1`.`a` > 3)select `t`.`a` AS `a` from `t` where `t`.`a` = 1 union select `s`.`a` AS `a` from `s` where `s`.`a` = 7 order by `a` desc latin1 latin1_swedish_ci
45004500
select * from v1;
45014501
a
45024502
7
@@ -4508,7 +4508,7 @@ s as (select * from t where a > 3)
45084508
select a from t where a=1 union select a from s where a=7 order by a desc;
45094509
show create view v1;
45104510
View Create View character_set_client collation_connection
4511-
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS with t as (select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` < 3), s as (select `t`.`a` AS `a` from `t` where `t`.`a` > 3)select `t`.`a` AS `a` from `t` where `t`.`a` = 1 union select `s`.`a` AS `a` from `s` where `s`.`a` = 7 order by `a` desc latin1 latin1_swedish_ci
4511+
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS with t as (select `t1`.`a` AS `a` from `t1` where `t1`.`a` < 3), s as (select `t`.`a` AS `a` from `t` where `t`.`a` > 3)select `t`.`a` AS `a` from `t` where `t`.`a` = 1 union select `s`.`a` AS `a` from `s` where `s`.`a` = 7 order by `a` desc latin1 latin1_swedish_ci
45124512
select * from v1;
45134513
a
45144514
1

mysql-test/main/cte_cycle.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ FROM t1, cte WHERE t1.from_ = cte.to_
6767
select * from cte;
6868
show create view v1;
6969
View Create View character_set_client collation_connection
70-
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS with recursive cte(`depth`,`from_`,`to_`) as (select 0 AS `depth`,1 AS `from_`,1 AS `to_` union select `cte`.`depth` + 1 AS `depth+1`,`test`.`t1`.`from_` AS `from_`,`test`.`t1`.`to_` AS `to_` from (`test`.`t1` join `cte`) where `test`.`t1`.`from_` = `cte`.`to_`) CYCLE `from_`,`to_` RESTRICT select `cte`.`depth` AS `depth`,`cte`.`from_` AS `from_`,`cte`.`to_` AS `to_` from `cte` latin1 latin1_swedish_ci
70+
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS with recursive cte(`depth`,`from_`,`to_`) as (select 0 AS `depth`,1 AS `from_`,1 AS `to_` union select `cte`.`depth` + 1 AS `depth+1`,`t1`.`from_` AS `from_`,`t1`.`to_` AS `to_` from (`t1` join `cte`) where `t1`.`from_` = `cte`.`to_`) CYCLE `from_`,`to_` RESTRICT select `cte`.`depth` AS `depth`,`cte`.`from_` AS `from_`,`cte`.`to_` AS `to_` from `cte` latin1 latin1_swedish_ci
7171
select * from v1;
7272
depth from_ to_
7373
0 1 1

0 commit comments

Comments
 (0)