gongzexin opened a new issue, #12606:
URL: https://github.com/apache/doris/issues/12606

   ### Search before asking
   
   - [X] I had searched in the 
[issues](https://github.com/apache/incubator-doris/issues?q=is%3Aissue) and 
found no similar issues.
   
   
   ### Version
   
   1.1.1
   
   ### What's Wrong?
   
   If the type of the mysql field is datetime/date and the value is 0000-00-00 
00:00:00/0000-00-00, the query results of the mysql external table are 
inconsistent with the original data.
   
   ### What You Expected?
   
   The result is consistent
   
   ### How to Reproduce?
   
   -- mysql create table sql
   CREATE TABLE `date_test` (
     `id` int(11) NOT NULL AUTO_INCREMENT,
     `sales_create_time` datetime DEFAULT NULL,
     `sales_update_time` datetime NOT NULL,
     PRIMARY KEY (`id`)
   ) ENGINE=InnoDB AUTO_INCREMENT=263 DEFAULT CHARSET=utf8;
   
   -- mysql table data
   INSERT INTO `date_test`(`id`, `sales_create_time`, `sales_update_time`) 
VALUES (253, '2015-08-05 23:15:25', '2015-08-05 23:15:44');
   INSERT INTO `date_test`(`id`, `sales_create_time`, `sales_update_time`) 
VALUES (254, '2015-08-05 21:25:53', '2015-08-05 23:02:03');
   INSERT INTO `date_test`(`id`, `sales_create_time`, `sales_update_time`) 
VALUES (255, '2015-08-05 20:20:17', '2015-08-05 20:54:32');
   INSERT INTO `date_test`(`id`, `sales_create_time`, `sales_update_time`) 
VALUES (256, '2015-08-05 22:32:21', '2015-08-05 23:45:19');
   INSERT INTO `date_test`(`id`, `sales_create_time`, `sales_update_time`) 
VALUES (257, '2015-08-06 19:07:21', '2015-08-06 19:07:37');
   INSERT INTO `date_test`(`id`, `sales_create_time`, `sales_update_time`) 
VALUES (258, '2015-08-05 21:22:59', '2015-08-05 21:23:08');
   INSERT INTO `date_test`(`id`, `sales_create_time`, `sales_update_time`) 
VALUES (259, '2015-08-06 19:07:25', '0000-00-00 00:00:00');
   INSERT INTO `date_test`(`id`, `sales_create_time`, `sales_update_time`) 
VALUES (260, '2015-08-05 20:51:55', '2015-08-05 23:51:45');
   INSERT INTO `date_test`(`id`, `sales_create_time`, `sales_update_time`) 
VALUES (261, '2015-08-05 19:41:27', '2015-08-06 00:30:43');
   INSERT INTO `date_test`(`id`, `sales_create_time`, `sales_update_time`) 
VALUES (262, '2015-08-06 02:56:58', '2015-08-06 02:58:29');
   
   -- doris external table
   CREATE EXTERNAL TABLE `source_date_test` (
     `id` largeint(40) NOT NULL COMMENT "",
     `sales_create_time` datetime NULL COMMENT "",
     `sales_update_time` datetime NULL COMMENT ""
   ) ENGINE=ODBC
   COMMENT "ODBC"
   PROPERTIES (
   "odbc_catalog_resource" = "xxx",
   "database" = "xxx",
   "table" = "date_test"
   );
   
   -- doris query sql
   select * from source_date_test;
   
   ### Anything Else?
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [X] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to