diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 18:07:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 18:07:14 +0000 |
commit | a175314c3e5827eb193872241446f2f8f5c9d33c (patch) | |
tree | cd3d60ca99ae00829c52a6ca79150a5b6e62528b /mysql-test/suite/perfschema/include/prepared_stmts_setup.inc | |
parent | Initial commit. (diff) | |
download | mariadb-10.5-upstream.tar.xz mariadb-10.5-upstream.zip |
Adding upstream version 1:10.5.12.upstream/1%10.5.12upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'mysql-test/suite/perfschema/include/prepared_stmts_setup.inc')
-rw-r--r-- | mysql-test/suite/perfschema/include/prepared_stmts_setup.inc | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/mysql-test/suite/perfschema/include/prepared_stmts_setup.inc b/mysql-test/suite/perfschema/include/prepared_stmts_setup.inc new file mode 100644 index 00000000..0fb14a36 --- /dev/null +++ b/mysql-test/suite/perfschema/include/prepared_stmts_setup.inc @@ -0,0 +1,20 @@ +# +# Creating various prepared statements. +# HELPER include/prepared_stmts_setup.inc +# + +CREATE TABLE t1 (a INT NOT NULL); +INSERT INTO t1 VALUES (4), (8), (11), (32), (80); + +# Prepared statments + +PREPARE st1 FROM 'SELECT SQRT(POW(?,2) + POW(?,2)) AS hypotenuse'; + +SET @table = 't1'; +SET @s = CONCAT('SELECT * FROM ', @table); +PREPARE st2 FROM @s; + +PREPARE st3 FROM 'INSERT INTO t1 SELECT * FROM t1 WHERE a<=?'; + +PREPARE st4 FROM + '(SELECT a FROM t1) UNION (SELECT a+10 FROM t1) ORDER BY RAND()*0+a'; |