Strange max(date) return in reader vs writer aurora mysql [closed]
-
06-03-2021 - |
Domanda
Something very strange happening here which I can't point out. Using AWS Aurora, select max(date) in the writer gives me one date, in the reader it returns strange date and warnings.. Column is datetime
.
writer:
MySQL [(none)]> select max(colDT) from tbl_example;
+---------------------+
| max(colDT) |
+---------------------+
| 2020-02-12 00:00:00 |
+---------------------+
reader:
MySQL [(none)]> select id from tbl_example where colDT=(select max(colDT) from tbl_example);
Empty set, 3 warnings (0.00 sec)
MySQL [(none)]> show warnings;
+---------+------+-----------------------------------------------------------------------------+
| Level | Code | Message |
+---------+------+-----------------------------------------------------------------------------+
| Warning | 1292 | Incorrect datetime value: ':082-05-31 31:63:51' for column 'colDT' at row 1 |
| Warning | 1292 | Incorrect datetime value: ':082-05-31 31:63:51' for column 'colDT' at row 1 |
| Warning | 1292 | Incorrect datetime value: ':082-05-31 31:63:51' for column 'colDT' at row 1 |
+---------+------+-----------------------------------------------------------------------------+
Some more strangeness:
MySQL [(none)]> select max(colDT),id from tbl_example ;
+---------------------+-------+
| max(colDT) | id |
+---------------------+-------+
| :082-05-31 31:63:51 | 94113 |
+---------------------+-------+
1 row in set (46.47 sec)
MySQL [(none)]> select * from tbl_example where id=94113;
+-------+-------+---------------------+---------+--------+---------+
| id | bbbbb | colDT | cc | dd | ee |
+-------+-------+---------------------+---------+--------+---------+
| 94113 | 1 | 2019-08-07 00:00:00 | 6 | 17 | 1 |
+-------+-------+---------------------+---------+--------+---------+
1 row in set (0.00 sec)
Table definition:
MySQL [(none)]> show create table tbl_example\G
*************************** 1. row ***************************
Table: tbl_example
Create Table: CREATE TABLE `tbl_example ` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`bbbbb` tinyint(4) NOT NULL,
`colDT` datetime NOT NULL,
`cc` int(11) unsigned NOT NULL,
`dd` int(11) unsigned NOT NULL,
`ee` bigint(20) unsigned NOT NULL,
PRIMARY KEY (`id`,`colDT`),
UNIQUE KEY `ux_date_dd` (`colDT`,`dd`),
KEY `dd` (`dd`),
KEY `cc` (`cc`)
) ENGINE=InnoDB AUTO_INCREMENT=1078720 DEFAULT CHARSET=latin1
/*!50500 PARTITION BY RANGE COLUMNS(colDT)
(PARTITION p20190601 VALUES LESS THAN ('2019-07-01') ENGINE = InnoDB,
PARTITION p20190701 VALUES LESS THAN ('2019-08-01') ENGINE = InnoDB,
PARTITION p20190801 VALUES LESS THAN ('2019-09-01') ENGINE = InnoDB,
PARTITION p20190901 VALUES LESS THAN ('2019-10-01') ENGINE = InnoDB */
Soluzione
Something was wrong in the reader, after a restart the issue went away.
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a dba.stackexchange