You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
87 lines
6.9 KiB
87 lines
6.9 KiB
#
|
|
# Bug#26091333 : ASSERTION `RC == TYPE_OK' FAILED
|
|
#
|
|
SET timestamp=1000;
|
|
SET time_zone='+00:00';
|
|
CREATE EVENT event1 ON SCHEDULE EVERY 15 MINUTE STARTS NOW() DO BEGIN END;
|
|
DROP EVENT event1;
|
|
SET timestamp=1000;
|
|
SET time_zone='+00:00';
|
|
SET timestamp=1000;
|
|
SET time_zone='+05:30';
|
|
CREATE EVENT event1 ON SCHEDULE EVERY 15 MINUTE DO BEGIN END;
|
|
SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_NAME='event1';
|
|
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
|
|
def test event1 root@localhost +00:00 SQL BEGIN END RECURRING NULL 15 MINUTE ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION 1970-01-01 00:16:40 NULL ENABLED NOT PRESERVE 1970-01-01 00:16:40 1970-01-01 00:16:40 # 1 utf8mb4 utf8mb4_0900_ai_ci utf8mb4_0900_ai_ci
|
|
CREATE VIEW v1 AS SELECT 1;
|
|
SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME='v1';
|
|
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE VERSION ROW_FORMAT TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE AUTO_INCREMENT CREATE_TIME UPDATE_TIME CHECK_TIME TABLE_COLLATION CHECKSUM CREATE_OPTIONS TABLE_COMMENT
|
|
def test v1 VIEW NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1970-01-01 00:16:40 NULL NULL NULL NULL NULL VIEW
|
|
CREATE TABLE t1(a int);
|
|
SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME='t1';
|
|
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE VERSION ROW_FORMAT TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE AUTO_INCREMENT CREATE_TIME UPDATE_TIME CHECK_TIME TABLE_COLLATION CHECKSUM CREATE_OPTIONS TABLE_COMMENT
|
|
def test t1 BASE TABLE InnoDB 10 Dynamic 0 0 16384 0 0 0 NULL 1970-01-01 00:16:40 NULL NULL utf8mb4_0900_ai_ci NULL
|
|
CREATE FUNCTION hello (s CHAR(20)) RETURNS CHAR(50) DETERMINISTIC RETURN CONCAT('Hello, ',s,'!');
|
|
SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE ROUTINE_NAME='hello';
|
|
SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
|
|
hello def test hello FUNCTION char 50 200 NULL NULL NULL utf8mb4 utf8mb4_0900_ai_ci char(50) SQL RETURN CONCAT('Hello, ',s,'!') NULL SQL SQL YES CONTAINS SQL NULL DEFINER 1970-01-01 00:16:40 1970-01-01 00:16:40 ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION root@localhost utf8mb4 utf8mb4_0900_ai_ci utf8mb4_0900_ai_ci
|
|
ALTER EVENT event1 RENAME TO event2;
|
|
SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_NAME='event2';
|
|
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
|
|
def test event2 root@localhost +00:00 SQL BEGIN END RECURRING NULL 15 MINUTE ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION 1970-01-01 00:16:40 NULL ENABLED NOT PRESERVE 1970-01-01 05:46:40 1970-01-01 05:46:40 # 1 utf8mb4 utf8mb4_0900_ai_ci utf8mb4_0900_ai_ci
|
|
DROP event event2;
|
|
ALTER VIEW v1 AS SELECT 2;
|
|
SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME='v1';
|
|
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE VERSION ROW_FORMAT TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE AUTO_INCREMENT CREATE_TIME UPDATE_TIME CHECK_TIME TABLE_COLLATION CHECKSUM CREATE_OPTIONS TABLE_COMMENT
|
|
def test v1 VIEW NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1970-01-01 05:46:40 NULL NULL NULL NULL NULL VIEW
|
|
DROP VIEW v1;
|
|
RENAME TABLE t1 TO t2;
|
|
SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME='t2';
|
|
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE VERSION ROW_FORMAT TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE AUTO_INCREMENT CREATE_TIME UPDATE_TIME CHECK_TIME TABLE_COLLATION CHECKSUM CREATE_OPTIONS TABLE_COMMENT
|
|
def test t2 BASE TABLE InnoDB 10 Dynamic 0 0 16384 0 0 0 NULL 1970-01-01 05:46:40 NULL NULL utf8mb4_0900_ai_ci NULL
|
|
DROP TABLE t2;
|
|
ALTER FUNCTION hello comment 'abcd';
|
|
SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE ROUTINE_NAME='hello';
|
|
SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
|
|
hello def test hello FUNCTION char 50 200 NULL NULL NULL utf8mb4 utf8mb4_0900_ai_ci char(50) SQL RETURN CONCAT('Hello, ',s,'!') NULL SQL SQL YES CONTAINS SQL NULL DEFINER 1970-01-01 05:46:40 1970-01-01 05:46:40 ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION abcd root@localhost utf8mb4 utf8mb4_0900_ai_ci utf8mb4_0900_ai_ci
|
|
DROP FUNCTION hello;
|
|
#
|
|
# Bug#28492272: Cases where combination of timestamp and time zone
|
|
# would result in conversion error when storing timestamp column in DD.
|
|
#
|
|
# Test case 1: Create table referenced in view when
|
|
# time_zone=-6:00 and timestamp=1235;
|
|
CREATE TABLE t1(i INT);
|
|
CREATE VIEW v1 AS SELECT * FROM t1;
|
|
DROP TABLE t1;
|
|
SET TIME_ZONE='-6:00';
|
|
SET TIMESTAMP=1235;
|
|
# Creating a table referenced in an existing view when
|
|
# timstamp+time zone is before beginning of epoch must not trigger
|
|
# assert.
|
|
CREATE TABLE t1(i INT);
|
|
SET TIMESTAMP=default;
|
|
SET TIME_ZONE=default;
|
|
DROP TABLE t1;
|
|
DROP VIEW v1;
|
|
# Test case 2: Altering view when timestamp=1235 and time_zone=-6:00
|
|
CREATE VIEW v1 AS SELECT 5;
|
|
SET TIME_ZONE='-6:00';
|
|
SET TIMESTAMP=1235;
|
|
# Altering a view when timstamp+time zone is before beginning of epoch
|
|
# must not trigger assert.
|
|
ALTER VIEW v1 AS SELECT 6;
|
|
SET TIMESTAMP=default;
|
|
SET TIME_ZONE=default;
|
|
DROP VIEW v1;
|
|
# Test case 3: Altering function when timestamp=1 and time_zone=-12:00
|
|
CREATE FUNCTION hello (s CHAR(20)) RETURNS CHAR(50) DETERMINISTIC
|
|
RETURN CONCAT('Hello, ',s,'!');
|
|
SET TIME_ZONE='-12:00';
|
|
SET TIMESTAMP=1;
|
|
# Altering a function when timstamp+time zone is before beginning of
|
|
# epoch must not trigger assert.
|
|
ALTER FUNCTION hello COMMENT 'This is a test';
|
|
SET TIME_ZONE= default;
|
|
SET TIMESTAMP= default;
|
|
DROP FUNCTION hello;
|
|
|