Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.3.7
-
None
-
Linux
Description
From a dump file generated by:
mysqldump --comments=0 --complete-insert=1 --default-character-set=utf8mb4 --disable-keys=1 --hex-blob=1 --no-create-db=1 --no-create-info=1 --set-charset=1 --tz-utc=1 test t1 > timestamp.dump |
Load it to a spider table:
mysql test < timestamp.dump |
And it fails with:
ERROR 1292 (22007) at line 13: Incorrect datetime value: '2018-03-25 02:40:00' for column 'b' at row 1
|
How to reproduce:
Create tables on at least two datanodes (spider children):
CREATE TABLE `t1` ( |
`a` int(10) unsigned NOT NULL AUTO_INCREMENT, |
`b` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), |
PRIMARY KEY (`a`); |
create the servers:
CREATE SERVER testserver1 FOREIGN DATA WRAPPER mysql options ( host 'testserver1.example.com', user 'test_user', password 'test_password', port 3306); |
CREATE SERVER testserver2 FOREIGN DATA WRAPPER mysql options ( host 'testserver2.example.com', user 'test_user', password 'test_password', port 3306); |
Create the spider table:
CREATE TABLE `t1` ( |
`a` int(10) unsigned NOT NULL AUTO_INCREMENT, |
`b` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), |
PRIMARY KEY (`a`) |
) ENGINE=SPIDER AUTO_INCREMENT=17 DEFAULT CHARSET=utf8mb4 |
PARTITION BY HASH (`a`) |
(PARTITION `p0` COMMENT = 'srv "testserver1", tbl "t1"' ENGINE = SPIDER, |
PARTITION `p1` COMMENT = 'srv "testserver2", tbl "t1"' ENGINE = SPIDER); |
Use the dumpfile:
cat timestamp.dump |
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; |
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; |
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; |
/*!40101 SET NAMES utf8mb4 */; |
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; |
/*!40103 SET TIME_ZONE='+00:00' */; |
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; |
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; |
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; |
|
LOCK TABLES `t1` WRITE;
|
/*!40000 ALTER TABLE `t1` DISABLE KEYS */; |
INSERT INTO `t1` (`a`, `b`) VALUES (3,'2018-03-25 02:40:00'),(5,'2018-03-25 00:30:00'),(13,'2018-03-24 23:30:00'),(15,'2018-03-25 01:30:00'); |
/*!40000 ALTER TABLE `t1` ENABLE KEYS */; |
UNLOCK TABLES;
|
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; |
|
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; |
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; |
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; |
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; |
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; |
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; |
and load with mysql test < timestamp.dump and it fails with:
ERROR 1292 (22007) at line 13: Incorrect datetime value: '2018-03-25 02:40:00' for column 'b' at row 1
|
This is of course a simplified table structure etc. from what we are using, but it shows the bug in an easier fashion.
Attachments
Issue Links
- relates to
-
MDEV-16157 federated corrupts timestamps
-
- Closed
-
-
MDEV-16508 spider: sql_mode not maintained between spider node and data nodes
-
- Closed
-
Activity
Field | Original Value | New Value |
---|---|---|
Fix Version/s | 10.3 [ 22126 ] | |
Assignee | Jacob Mathew [ jacob-mathew ] |
Status | Open [ 1 ] | In Progress [ 3 ] |
Status | In Progress [ 3 ] | Stalled [ 10000 ] |
Description |
From a dump file generated by:
mysqldump --comments=0 --complete-insert=1 --default-character-set=utf8mb4 --disable-keys=1 --hex-blob=1 --no-create-db=1 --no-create-info=1 --set-charset=1 --tz-utc=1 test t1 > timestamp.dump Load it to a spider table: mysql test < timestamp.dump And it fails with: ERROR 1292 (22007) at line 13: Incorrect datetime value: '2018-03-25 02:40:00' for column 'b' at row 1 How to reproduce: Create tables on at least two datanodes (spider children): CREATE TABLE `t1` ( `a` int(10) unsigned NOT NULL AUTO_INCREMENT, `b` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), PRIMARY KEY (`a`); create the servers: CREATE SERVER testserver1 FOREIGN DATA WRAPPER mysql options ( host 'testserver1.example.com', user 'test_user', password 'test_password', port 3306); CREATE SERVER testserver2 FOREIGN DATA WRAPPER mysql options ( host 'testserver2.example.com', user 'test_user', password 'test_password', port 3306); Create the spider table: CREATE TABLE `t1` ( `a` int(10) unsigned NOT NULL AUTO_INCREMENT, `b` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), PRIMARY KEY (`a`) ) ENGINE=SPIDER AUTO_INCREMENT=17 DEFAULT CHARSET=utf8mb4 PARTITION BY HASH (`a`) (PARTITION `p0` COMMENT = 'srv "testserver1", tbl "t1"' ENGINE = SPIDER, PARTITION `p1` COMMENT = 'srv "testserver2", tbl "t1"' ENGINE = SPIDER); Use the dumpfile: cat timestamp.dump /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; LOCK TABLES `t1` WRITE; /*!40000 ALTER TABLE `t1` DISABLE KEYS */; INSERT INTO `t1` (`a`, `b`) VALUES (3,'2018-03-25 02:40:00'),(5,'2018-03-25 00:30:00'),(13,'2018-03-24 23:30:00'),(15,'2018-03-25 01:30:00'); /*!40000 ALTER TABLE `t1` ENABLE KEYS */; UNLOCK TABLES; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; and load with 'mysql test < timestamp.dump' and it fails with: ERROR 1292 (22007) at line 13: Incorrect datetime value: '2018-03-25 02:40:00' for column 'b' at row 1 This is of course a simplified table structure etc. from what we are using, but it shows the bug in an easier fashion. |
From a dump file generated by:
{code:bash} mysqldump --comments=0 --complete-insert=1 --default-character-set=utf8mb4 --disable-keys=1 --hex-blob=1 --no-create-db=1 --no-create-info=1 --set-charset=1 --tz-utc=1 test t1 > timestamp.dump {code} Load it to a spider table: {code:bash} mysql test < timestamp.dump {code} And it fails with: {noformat} ERROR 1292 (22007) at line 13: Incorrect datetime value: '2018-03-25 02:40:00' for column 'b' at row 1 {noformat} How to reproduce: Create tables on at least two datanodes (spider children): {code:sql} CREATE TABLE `t1` ( `a` int(10) unsigned NOT NULL AUTO_INCREMENT, `b` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), PRIMARY KEY (`a`); {code} create the servers: {code:sql} CREATE SERVER testserver1 FOREIGN DATA WRAPPER mysql options ( host 'testserver1.example.com', user 'test_user', password 'test_password', port 3306); CREATE SERVER testserver2 FOREIGN DATA WRAPPER mysql options ( host 'testserver2.example.com', user 'test_user', password 'test_password', port 3306); {code} Create the spider table: {code:sql} CREATE TABLE `t1` ( `a` int(10) unsigned NOT NULL AUTO_INCREMENT, `b` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), PRIMARY KEY (`a`) ) ENGINE=SPIDER AUTO_INCREMENT=17 DEFAULT CHARSET=utf8mb4 PARTITION BY HASH (`a`) (PARTITION `p0` COMMENT = 'srv "testserver1", tbl "t1"' ENGINE = SPIDER, PARTITION `p1` COMMENT = 'srv "testserver2", tbl "t1"' ENGINE = SPIDER); {code} Use the dumpfile: {code:sql|title=cat timestamp.dump} /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; LOCK TABLES `t1` WRITE; /*!40000 ALTER TABLE `t1` DISABLE KEYS */; INSERT INTO `t1` (`a`, `b`) VALUES (3,'2018-03-25 02:40:00'),(5,'2018-03-25 00:30:00'),(13,'2018-03-24 23:30:00'),(15,'2018-03-25 01:30:00'); /*!40000 ALTER TABLE `t1` ENABLE KEYS */; UNLOCK TABLES; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; {code} and load with {{mysql test < timestamp.dump}} and it fails with: {noformat} ERROR 1292 (22007) at line 13: Incorrect datetime value: '2018-03-25 02:40:00' for column 'b' at row 1 {noformat} This is of course a simplified table structure etc. from what we are using, but it shows the bug in an easier fashion. |
Link |
This issue relates to |
Status | Stalled [ 10000 ] | In Progress [ 3 ] |
Assignee | Jacob Mathew [ jacob-mathew ] | Kentoku [ kentoku ] |
Status | In Progress [ 3 ] | In Review [ 10002 ] |
Link |
This issue relates to |
Assignee | Kentoku [ kentoku ] | Jacob Mathew [ jacob-mathew ] |
Status | In Review [ 10002 ] | Stalled [ 10000 ] |
Status | Stalled [ 10000 ] | In Progress [ 3 ] |
Fix Version/s | 10.3.9 [ 23114 ] | |
Fix Version/s | 10.3 [ 22126 ] | |
Resolution | Fixed [ 1 ] | |
Status | In Progress [ 3 ] | Closed [ 6 ] |
Fix Version/s | 10.4.0 [ 23115 ] |
Workflow | MariaDB v3 [ 87387 ] | MariaDB v4 [ 154403 ] |
Zendesk Related Tickets | 177946 |
Upon precisely following the instructions for reproducing in the bug description using the latest MariaDB Server 10.3 code, the load succeeds. The reported problem does not reproduce:
Wed May 23 18:07 jacob@JM-Linux-Server-VM ~/MariaDB
160> my -u root test
Server version: 10.3.7-MariaDB-debug-log Source distribution
MariaDB [test]>
MariaDB [test]> LOCK TABLES `t1` WRITE;
Records: 4 Duplicates: 0 Warnings: 0
MariaDB [test]> UNLOCK TABLES;
MariaDB [test]>
MariaDB [test]>
| a | b |
| 3 | 2018-03-25 02:40:00 |
| 5 | 2018-03-25 00:30:00 |
| 13 | 2018-03-24 23:30:00 |
| 15 | 2018-03-25 01:30:00 |
Aborted
Wed May 23 18:14 jacob@JM-Linux-Server-VM ~/MariaDB
160>