summaryrefslogtreecommitdiffstats
path: root/mysql-test/suite/innodb_gis/r/multi_pk.result
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 18:00:34 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 18:00:34 +0000
commit3f619478f796eddbba6e39502fe941b285dd97b1 (patch)
treee2c7b5777f728320e5b5542b6213fd3591ba51e2 /mysql-test/suite/innodb_gis/r/multi_pk.result
parentInitial commit. (diff)
downloadmariadb-upstream.tar.xz
mariadb-upstream.zip
Adding upstream version 1:10.11.6.upstream/1%10.11.6upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'mysql-test/suite/innodb_gis/r/multi_pk.result')
-rw-r--r--mysql-test/suite/innodb_gis/r/multi_pk.result57
1 files changed, 57 insertions, 0 deletions
diff --git a/mysql-test/suite/innodb_gis/r/multi_pk.result b/mysql-test/suite/innodb_gis/r/multi_pk.result
new file mode 100644
index 00000000..9e0cfa06
--- /dev/null
+++ b/mysql-test/suite/innodb_gis/r/multi_pk.result
@@ -0,0 +1,57 @@
+create table t1 (c1 int, c2 varchar(255), c3 geometry not null, primary key(c1, c2), spatial index (c3))engine=innodb;
+create function rand_string(str_length tinyint unsigned, str_type tinyint unsigned) returns varchar(255)
+begin
+declare counter int unsigned default 0;
+declare const_chars varchar(64) default '0123456789';
+declare result varchar(255) default '';
+if str_type = 1 then
+set const_chars = '0123456789';
+elseif str_type = 2 then
+set const_chars = 'abcdefghijklmnopqrstuvwxyz';
+elseif str_type = 3 then
+set const_chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
+elseif str_type = 4 then
+set const_chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
+elseif str_type = 5 then
+set const_chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
+else
+set const_chars = '0123456789';
+end if;
+while counter < str_length do
+set result = concat(result,substr(const_chars,ceil(rand()*(length(const_chars)-1)),1));
+set counter = counter + 1;
+end while;
+return result;
+end|
+create procedure insert_t1(IN total int)
+begin
+declare i int default 1;
+declare i2 int default 1;
+declare str varchar(100) default '';
+declare dup_key int default 1;
+while i <= total DO
+set i2 = floor(0+(rand()*100));
+set str = rand_string(i2, 5);
+select count(*) into dup_key from t1 where c2 = str and c1 = i;
+while dup_key <> 0 do
+set i2 = floor(0+(rand()*100));
+set str = rand_string(i2, 5);
+select count(*) into dup_key from t1 where c2 = str and c1 = i;
+end while;
+insert into t1 values (i, str, Point(i, i));
+set i = i + 1;
+end while;
+end|
+CALL insert_t1(10000);
+check table t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+start transaction;
+CALL insert_t1(30000);
+rollback;
+check table t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+drop procedure insert_t1;
+drop function rand_string;
+drop table t1;