Identation fixes
This commit is contained in:
parent
0be46b976c
commit
b67e7cc8d6
|
@ -1,32 +1,32 @@
|
|||
DROP TEMPORARY TABLE IF EXISTS tData;
|
||||
CREATE TEMPORARY TABLE tData
|
||||
SELECT 1 `group`, 1 `ival`, 10 `num`
|
||||
UNION SELECT 1, 3, -2
|
||||
UNION SELECT 1, 2, 1
|
||||
UNION SELECT 1, 3, -1
|
||||
UNION SELECT 1, 2, -5
|
||||
UNION SELECT 2, '1', 20
|
||||
UNION SELECT 2, '3', -5
|
||||
UNION SELECT 2, '2', 1
|
||||
UNION SELECT 2, '3', 10
|
||||
UNION SELECT 2, '2', -6
|
||||
UNION SELECT 3, 2, 8
|
||||
UNION SELECT 3, 3, 10
|
||||
UNION SELECT 4, 2, 10
|
||||
UNION SELECT 4, 3, -24
|
||||
UNION SELECT 5, NULL, 0
|
||||
UNION SELECT 5, NULL, -4;
|
||||
UNION SELECT 1, 3, -2
|
||||
UNION SELECT 1, 2, 1
|
||||
UNION SELECT 1, 3, -1
|
||||
UNION SELECT 1, 2, -5
|
||||
UNION SELECT 2, '1', 20
|
||||
UNION SELECT 2, '3', -5
|
||||
UNION SELECT 2, '2', 1
|
||||
UNION SELECT 2, '3', 10
|
||||
UNION SELECT 2, '2', -6
|
||||
UNION SELECT 3, 2, 8
|
||||
UNION SELECT 3, 3, 10
|
||||
UNION SELECT 4, 2, 10
|
||||
UNION SELECT 4, 3, -24
|
||||
UNION SELECT 5, NULL, 0
|
||||
UNION SELECT 5, NULL, -4;
|
||||
|
||||
DROP TEMPORARY TABLE IF EXISTS tExpect;
|
||||
CREATE TEMPORARY TABLE tExpect
|
||||
SELECT 1 `group`, 3 expect
|
||||
UNION SELECT 2, 15
|
||||
UNION SELECT 3, 0
|
||||
UNION SELECT 4, -14
|
||||
UNION SELECT 5, -4;
|
||||
SELECT 1 `group`, 3 expect
|
||||
UNION SELECT 2, 15
|
||||
UNION SELECT 3, 0
|
||||
UNION SELECT 4, -14
|
||||
UNION SELECT 5, -4;
|
||||
|
||||
SELECT e.`group`, r.result, e.expect, r.result <=> e.expect isRight
|
||||
FROM tExpect e
|
||||
FROM tExpect e
|
||||
LEFT JOIN (
|
||||
SELECT `group`, minacum(`ival`, `num`, 1) result
|
||||
FROM tData GROUP BY `group`
|
||||
|
|
|
@ -1,32 +1,32 @@
|
|||
DROP TEMPORARY TABLE IF EXISTS tData;
|
||||
CREATE TEMPORARY TABLE tData
|
||||
SELECT 1 `group`, 1 `max`, 10 `value`
|
||||
UNION SELECT 1, 3, 30
|
||||
UNION SELECT 1, 2, 20
|
||||
UNION SELECT 1, 3, 31
|
||||
UNION SELECT 1, 2, 21
|
||||
UNION SELECT 2, '4', 40
|
||||
UNION SELECT 2, '6', 60
|
||||
UNION SELECT 2, '5', 50
|
||||
UNION SELECT 2, '6', 61
|
||||
UNION SELECT 2, '5', 51
|
||||
UNION SELECT 3, 7, 70
|
||||
UNION SELECT 3, 9, 90
|
||||
UNION SELECT 3, 8, 80
|
||||
UNION SELECT 3, 9, NULL
|
||||
UNION SELECT 3, 8, 81
|
||||
UNION SELECT 4, NULL, 101
|
||||
UNION SELECT 4, NULL, 102;
|
||||
UNION SELECT 1, 3, 30
|
||||
UNION SELECT 1, 2, 20
|
||||
UNION SELECT 1, 3, 31
|
||||
UNION SELECT 1, 2, 21
|
||||
UNION SELECT 2, '4', 40
|
||||
UNION SELECT 2, '6', 60
|
||||
UNION SELECT 2, '5', 50
|
||||
UNION SELECT 2, '6', 61
|
||||
UNION SELECT 2, '5', 51
|
||||
UNION SELECT 3, 7, 70
|
||||
UNION SELECT 3, 9, 90
|
||||
UNION SELECT 3, 8, 80
|
||||
UNION SELECT 3, 9, NULL
|
||||
UNION SELECT 3, 8, 81
|
||||
UNION SELECT 4, NULL, 101
|
||||
UNION SELECT 4, NULL, 102;
|
||||
|
||||
DROP TEMPORARY TABLE IF EXISTS tExpect;
|
||||
CREATE TEMPORARY TABLE tExpect
|
||||
SELECT 1 `group`, 31 expect
|
||||
UNION SELECT 2, 61
|
||||
UNION SELECT 3, NULL
|
||||
UNION SELECT 4, 102;
|
||||
SELECT 1 `group`, 31 expect
|
||||
UNION SELECT 2, 61
|
||||
UNION SELECT 3, NULL
|
||||
UNION SELECT 4, 102;
|
||||
|
||||
SELECT e.`group`, r.result, e.expect, r.result <=> e.expect isRight
|
||||
FROM tExpect e
|
||||
FROM tExpect e
|
||||
LEFT JOIN (
|
||||
SELECT `group`, multimax(`max`, `value`) result
|
||||
FROM tData GROUP BY `group`
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
DROP TEMPORARY TABLE IF EXISTS tData;
|
||||
CREATE TEMPORARY TABLE tData
|
||||
SELECT sql_printf('SELECT %v FROM %t', 1, 'tbl') result, 'SELECT 1 FROM `tbl`' expect
|
||||
UNION SELECT sql_printf('%v', TRUE), 1
|
||||
UNION SELECT sql_printf('%v', 1), 1
|
||||
UNION SELECT sql_printf('%v', TRUE), 1
|
||||
UNION SELECT sql_printf('%v', 1), 1
|
||||
UNION SELECT sql_printf('%v', 'string'), '\'string\''
|
||||
UNION SELECT sql_printf('%v', DATE('2020-01-01')), '\'2020-01-01\''
|
||||
UNION SELECT sql_printf('%v', NULL), 'NULL'
|
||||
UNION SELECT sql_printf('%t', 'myTable'), '`myTable`'
|
||||
UNION SELECT sql_printf('%s', 'expr = TRUE'), 'expr = TRUE'
|
||||
UNION SELECT sql_printf('%%'), '%'
|
||||
UNION SELECT sql_printf(NULL), NULL
|
||||
UNION SELECT sql_printf('SELECT %'), NULL
|
||||
UNION SELECT sql_printf('SELECT %v'), NULL;
|
||||
UNION SELECT sql_printf('%%'), '%'
|
||||
UNION SELECT sql_printf(NULL), NULL
|
||||
UNION SELECT sql_printf('SELECT %'), NULL
|
||||
UNION SELECT sql_printf('SELECT %v'), NULL;
|
||||
|
||||
SELECT result, expect, result <=> expect isRight FROM tData;
|
||||
|
||||
|
|
|
@ -7,12 +7,12 @@ DELIMITER $$
|
|||
CREATE PROCEDURE udf_test(vLoops BIGINT)
|
||||
BEGIN
|
||||
DECLARE vI BIGINT DEFAULT 0;
|
||||
DECLARE vRes VARCHAR(255);
|
||||
DECLARE vRes VARCHAR(255);
|
||||
|
||||
WHILE vI < vLoops DO
|
||||
WHILE vI < vLoops DO
|
||||
SELECT minacum(2, -10, 1) INTO vRes;
|
||||
SET vI = vI + 1;
|
||||
END WHILE;
|
||||
SET vI = vI + 1;
|
||||
END WHILE;
|
||||
END$$
|
||||
DELIMITER ;
|
||||
|
||||
|
|
Reference in New Issue