mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
P_S 5.7.28
This commit is contained in:
20
mysql-test/suite/perfschema/include/prepared_stmts_setup.inc
Normal file
20
mysql-test/suite/perfschema/include/prepared_stmts_setup.inc
Normal file
@@ -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';
|
Reference in New Issue
Block a user