Created
June 16, 2017 21:36
-
-
Save elenst/26190afbc09f120afd3f29e771a26734 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DELIMITER $ | |
CREATE PROCEDURE pr_create() | |
BEGIN | |
DECLARE i INT DEFAULT 0; | |
WHILE i < 3000 | |
DO | |
SET @sql = CONCAT('CREATE TABLE t', i, ' (i INT)'); | |
PREPARE stmt FROM @sql; | |
EXECUTE stmt; | |
DEALLOCATE PREPARE stmt; | |
SET i = i + 1; | |
END WHILE; | |
END $ | |
DELIMITER ; | |
DELIMITER $ | |
CREATE PROCEDURE pr_is() | |
BEGIN | |
DECLARE i INT DEFAULT 0; | |
WHILE i < 3000 | |
DO | |
SELECT TABLE_SCHEMA TABLE_CAT, NULL TABLE_SCHEM, TABLE_NAME, TABLE_TYPE, TABLE_COMMENT REMARKS, NULL TYPE_CAT, NULL TYPE_SCHEM, NULL TYPE_NAME, NULL SELF_REFERENCING_COL_NAME, NULL REF_GENERATION FROM INFORMATION_SCHEMA.TABLES WHERE (TABLE_SCHEMA = 'test') AND (TABLE_NAME LIKE 'sys_storage_table_alias') ORDER BY TABLE_TYPE, TABLE_SCHEMA, TABLE_NAME; | |
SET i = i + 1; | |
END WHILE; | |
END $ | |
DELIMITER ; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment