1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Merge branch '10.9' into 10.10

This commit is contained in:
Oleksandr Byelkin
2023-08-05 16:14:46 +02:00
867 changed files with 12543 additions and 6345 deletions

View File

@ -7,6 +7,7 @@ drop table if exists t1;
--echo # Test alter sequence
--echo #
--disable_ps2_protocol
CREATE SEQUENCE t1 nocache engine=myisam;
select * from t1;
select next value for t1;
@ -173,3 +174,5 @@ SHOW CREATE SEQUENCE s2;
DROP SEQUENCE s2;
RENAME TABLE s1 TO s2;
DROP SEQUENCE s2;
--enable_ps2_protocol

View File

@ -10,6 +10,7 @@ create database s_db;
create sequence s_db.s1;
grant select on s_db.s1 to normal_1@'%' identified by 'pass';
--disable_ps2_protocol
connect(m_normal_1, localhost, normal_1, pass, s_db);
select * from s1;
--error ER_TABLEACCESS_DENIED_ERROR
@ -30,6 +31,7 @@ alter sequence s1 restart 50;
select nextval(s1);
--error ER_TABLEACCESS_DENIED_ERROR
drop sequence s1;
--enable_ps2_protocol
connection default;
disconnect m_normal_1;

View File

@ -8,6 +8,7 @@
set @@default_storage_engine="aria";
--disable_ps2_protocol
CREATE SEQUENCE t1 cache=10;
show create sequence t1;
select NEXT VALUE for t1,seq from seq_1_to_20;
@ -41,3 +42,4 @@ select next value for t2;
alter table t2 rename to t1;
select next value for t1;
drop table t1;
--enable_ps2_protocol

View File

@ -4,6 +4,7 @@
# tests with auto_increment_increment and auto_increment_offset
#
--disable_ps2_protocol
set global auto_increment_increment= 2, auto_increment_offset= 2;
create sequence s start with -3 minvalue= -1000 increment 0;
@ -24,6 +25,7 @@ select nextval(s);
flush tables;
select nextval(s);
drop sequence s;
--enable_ps2_protocol
# Clean up

View File

@ -11,10 +11,12 @@ reset master; # get rid of previous tests binlog
--enable_query_log
create or replace sequence s1 cache 3;
--disable_ps2_protocol
select next value for s1, minimum_value from s1 where maximum_value> 1;
select next value for s1, minimum_value from s1 where maximum_value> 2;
select next value for s1, minimum_value from s1 where maximum_value> 3;
select next value for s1, minimum_value from s1 where maximum_value> 4;
--enable_ps2_protocol
#
# Alter sequence

View File

@ -69,7 +69,9 @@ FLUSH TABLES;
--disconnect con1
--connection default
--disable_ps2_protocol
SELECT NEXTVAL(s1);
--enable_ps2_protocol
COMMIT;
# Cleanup

View File

@ -379,6 +379,7 @@ drop view v1;
# CREATE TEMPORARY SEQUENCE
#
--disable_ps2_protocol
CREATE TEMPORARY SEQUENCE t1;
select next value for t1;
drop temporary table t1;
@ -411,6 +412,7 @@ select previous value for t1;
drop temporary sequence t1;
select previous value for t1;
drop sequence t1;
--enable_ps2_protocol
#
# Check that we can't create anything with the sequence engine

View File

@ -29,10 +29,12 @@ INSERT into t1 values(default(a),10);
INSERT into t1 values(default(a),default(a));
update t1 set a=default(a), b=12 where b=2;
select * from t1;
--disable_ps2_protocol
select default(a), a, b from t1;
select * from s1;
select * from t1 where default(a) > 0;
select * from s1;
--enable_ps2_protocol
--echo #
--echo # View
@ -70,7 +72,9 @@ UNLOCK TABLES;
LOCK TABLE t1 WRITE, s1 WRITE;
insert into t1 (b) values (5),(6);
--disable_ps2_protocol
select default(a) from t1;
--enable_ps2_protocol
UNLOCK TABLES;
LOCK TABLE t1 READ;

View File

@ -22,6 +22,7 @@ connect(read_write,localhost,read_write,,mysqltest_1);
connect(alter,localhost,alter,,mysqltest_1);
connect(only_alter, localhost, only_alter,,mysqltest_1);
--disable_ps2_protocol
connection normal;
create sequence s1;
select next value for s1;
@ -52,6 +53,7 @@ select next value for s1;
alter sequence s1 restart= 11;
--error ER_TABLEACCESS_DENIED_ERROR
select * from s1;
--enable_ps2_protocol
#
# Cleanup

View File

@ -6,6 +6,7 @@
--source include/master-slave.inc
--source include/have_innodb.inc
--disable_ps2_protocol
connection master;
create database s_db;
grant all on s_db.* to normal_1@'%' identified by 'pass';
@ -704,5 +705,6 @@ drop user normal_2@'%';
drop user normal_3@'%';
drop user normal_4@'%';
drop user normal_5@'%';
--enable_ps2_protocol
--source include/rpl_end.inc

View File

@ -5,6 +5,7 @@
# Test sequence generation
#
--disable_ps2_protocol
CREATE SEQUENCE t1 start with 1 minvalue 1 maxvalue 10 increment by 1 cache 2 cycle;
show create table t1;
select next value for t1;
@ -297,3 +298,4 @@ SELECT SETVAL (v,0);
UNLOCK TABLES;
DROP VIEW v;
--disable_ps2_protocol

View File

@ -9,6 +9,7 @@
--echo # Create and check
--echo #
--disable_ps2_protocol
create sequence s1 engine=innodb;
check table s1;
select next value for s1;
@ -27,6 +28,7 @@ check table s1;
select next value for s1;
select * from s1;
drop sequence s1;
--enable_ps2_protocol
--echo #
--echo # INSERT
@ -45,7 +47,9 @@ insert into s1 values(0,9223372036854775806,1,1,1,1000,0,0);
select * from s1;
insert into s1 values(1000,1,9223372036854775806,1,1,1000,0,0);
select * from s1;
--disable_ps2_protocol
select next value for s1;
--enable_ps2_protocol
select * from s1;
--error ER_SEQUENCE_INVALID_DATA
insert into s2 values(0, 1, 10, 1, 2, 1, 1, 0);
@ -98,6 +102,7 @@ drop table s1;
--echo # Many sequence calls with innodb
--echo #
--disable_ps2_protocol
create sequence s1 cache=1000 engine=innodb;
start transaction;
select count(nextval(s1)) from seq_1_to_2000;
@ -120,11 +125,13 @@ connection default;
select * from s1;
commit;
drop sequence s1;
--enable_ps2_protocol
--echo #
--echo # Flush tables with read lock
--echo #
--disable_ps2_protocol
create sequence s1;
select next value for s1;
flush tables with read lock;
@ -134,6 +141,7 @@ create sequence s2;
select next value for s1;
unlock tables;
drop sequence s1;
--enable_ps2_protocol
--echo #
--echo # MDEV-14761

View File

@ -39,6 +39,8 @@ select * from s1;
--let $restart_parameters=
--source include/restart_mysqld.inc
select * from s1;
--disable_ps2_protocol
select next value for s1;
--enable_ps2_protocol
select * from s1;
drop sequence s1;

View File

@ -9,6 +9,7 @@
--source include/master-slave.inc
--source include/have_innodb.inc
--disable_ps2_protocol
connection master;
create database s_db;
use s_db;
@ -868,6 +869,7 @@ select * from t1;
select * from s1;
connection master;
drop table t1,s1;
--enable_ps2_protocol
#
# Cleanup

View File

@ -9,7 +9,9 @@
--echo #
CREATE SEQUENCE s1 ENGINE=InnoDB;
--disable_ps2_protocol
SELECT NEXTVAL(s1);
--enable_ps2_protocol
CREATE TABLE t1 ENGINE=InnoDB SELECT LASTVAL(s1) AS a;
INSERT INTO t1 VALUES (NEXTVAL(s1));
INSERT INTO t1 VALUES (LASTVAL(s1));

View File

@ -7,6 +7,7 @@ drop table if exists t1;
--echo # Test setval function
--echo #
--disable_ps2_protocol
CREATE SEQUENCE t1 cache 10 engine=myisam;
select next_not_cached_value,cycle_count from t1;
do setval(t1,10);
@ -151,6 +152,6 @@ SELECT SETVAL(s, 10);
# Cleanup
DROP SEQUENCE s;
--enable_ps2_protocol
--echo # End of 10.3 tests

View File

@ -5,6 +5,7 @@
# MDEV-14092 NEXTVAL() fails on slave
#
--disable_ps2_protocol
CREATE SEQUENCE s;
INSERT INTO s VALUES (1,1,4,1,1,1,0,0);
show create sequence s;
@ -125,6 +126,7 @@ END $
--connection master
DROP SEQUENCE s;
DROP PROCEDURE pr;
--enable_ps2_protocol
#
# Cleanup

View File

@ -11,7 +11,9 @@
create temporary sequence s1 engine=innodb;
alter table s1 engine myisam;
--disable_ps2_protocol
select nextval(s1);
--enable_ps2_protocol
select * from s1;
drop temporary sequence s1;
@ -28,6 +30,7 @@ DROP TEMPORARY SEQUENCE s1;
--echo # MDEV-13007 ALTER .. ENGINE on temporary sequence may go wrong
--echo #
--disable_ps2_protocol
create temporary sequence s1 engine=aria;
alter table s1 engine myisam;
select nextval(s1);
@ -41,3 +44,4 @@ alter table s1 engine innodb;
select nextval(s1);
select nextval(s1);
drop temporary sequence s1;
--enable_ps2_protocol

View File

@ -8,9 +8,11 @@
create sequence s1;
create view v1 as select * from s1;
create view v2 as select next value for s1;
--disable_ps2_protocol
select * from v1;
select * from v2;
select * from v2;
--enable_ps2_protocol
--error ER_NOT_SEQUENCE
select next value for v1;
drop sequence s1;