You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "wxlfight (via GitHub)" <gi...@apache.org> on 2023/06/27 02:52:26 UTC

[GitHub] [doris] wxlfight opened a new issue, #21217: [Bug] doris发送错误的fieldpacket,导致mysql驱动将数据库的largeInt解析成String

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

   ### Search before asking
   
   - [X] I had searched in the [issues](https://github.com/apache/doris/issues?q=is%3Aissue) and found no similar issues.
   
   
   ### Version
   
   doris version: 5.7.37
   ![image](https://github.com/apache/doris/assets/5794010/1eba4594-180f-4188-9cd0-dc4a3e681c9e)
   
   
   ### What's Wrong?
   
   【问题描述】:
   doris数据库的largeint字段(截图中的op_userid字段)通过该mysql驱动读取过来(驱动在unpackField的过程),变成String类型,如图所示:
   ![image](https://github.com/apache/doris/assets/5794010/b558f177-7e70-4698-8b51-658e9a4cd9d3)
   MysqlType中254对应的是String类型:
   ![image](https://github.com/apache/doris/assets/5794010/b72df804-da7a-4cc2-8df3-a20ace95d81a)
   
   
   
   
   
   
   
   ### What You Expected?
   
   使用mysql驱动从doris数据库读取largeInt字段时,doris数据库应该发送正确的数据结构,使mysql驱动解析成UNSIGNED BIGINT。对应文档:https://doris.apache.org/docs/dev/lakehouse/multi-catalog/jdbc?_highlight=jdbc
   ![image](https://github.com/apache/doris/assets/5794010/4059c1bc-0727-470a-b151-3b1b66eefeb9)
   
   
   ### How to Reproduce?
   
   【mysql 驱动版本】:
   `<dependency>
               <groupId>mysql</groupId>
               <artifactId>mysql-connector-java</artifactId>
               <version>8.0.28</version>
   </dependency>
   `
   【数据库样例数据】
   `
   CREATE DATABASE doris;
   USE doris;
   CREATE TABLE IF NOT EXISTS doris.example_tbl
   (
       `timestamp` DATE NOT NULL COMMENT "['0000-01-01', '9999-12-31']",
       `type` TINYINT NOT NULL COMMENT "[-128, 127]",
       `error_code` INT COMMENT "[-2147483648, 2147483647]",
       `error_msg` VARCHAR(300) COMMENT "[1-65533]",
       `op_id` BIGINT COMMENT "[-9223372036854775808, 9223372036854775807]",
       `op_time` DATETIME COMMENT "['0000-01-01 00:00:00', '9999-12-31 23:59:59']",
       `target` float COMMENT "4 字节",
       `source` double COMMENT "8 字节",
       `lost_cost` decimal(20,4) COMMENT "",
       `remark` string COMMENT "1m size",
       `op_userid` LARGEINT COMMENT "[-2^127 + 1 ~ 2^127 - 1]",
       `plate` SMALLINT COMMENT "[-32768, 32767]",
       `iscompleted` boolean COMMENT "true 或者 false"
   )
   DUPLICATE KEY(`timestamp`, `type`)
   DISTRIBUTED BY HASH(`type`) BUCKETS 1
   PROPERTIES (
       "replication_allocation" = "tag.location.default: 1"
   ); 
   
   INSERT INTO doris.example_tbl (`timestamp`, `type`, `error_code`, `error_msg`, `op_id`, `op_time`, `target`, `source`, `lost_cost`, `remark`, `op_userid`, `plate`, `iscompleted`)
   VALUES
       ('2022-01-01', 1, 1001, 'error message 1', 1234567890123, '2022-01-01 00:00:00', 1.23, 4.56, 123456789012345.6789, 'remark 1', 9223372036854775807, 32767, true),
       ('2022-01-02', 2, 1002, 'error message 2', 9876543210987, '2022-01-02 12:34:56', 4.56, 7.89, 98765432109876.5432, 'remark 2', -9223372036854775808, -32768, false),
       ('2022-01-03', 3, 1003, 'error message 3', 4567890123456, '2022-01-03 23:59:59', 7.89, 1.23, 11111111111111.1111, 'remark 3', 1234567890123, 0, true);
   select * from doris.example_tbl
   `
   写一个查询脚本就可以开始调试。
   
   
   ### Anything Else?
   
   我额外对mysql-connector-java-5.1.47.jar做了测试,也是同样的问题
   ![image](https://github.com/apache/doris/assets/5794010/f255aa2c-2b37-4ae9-965a-55c40989ebe5)
   
   
   ### Are you willing to submit PR?
   
   - [ ] 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-unsubscribe@doris.apache.org.apache.org

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


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


[GitHub] [doris] jacktengg commented on issue #21217: [Bug] doris发送错误的fieldpacket,导致mysql驱动将数据库的largeInt解析成String

Posted by "jacktengg (via GitHub)" <gi...@apache.org>.
jacktengg commented on issue #21217:
URL: https://github.com/apache/doris/issues/21217#issuecomment-1659492920

   MySQL client/sever protocol does not support 128 bit integer. Seem common way is to parse out-of-range numbers as string type and the client side parse it back to numbers.


-- 
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-unsubscribe@doris.apache.org

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


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


[GitHub] [doris] stalary commented on issue #21217: [Bug] doris发送错误的fieldpacket,导致mysql驱动将数据库的largeInt解析成String

Posted by "stalary (via GitHub)" <gi...@apache.org>.
stalary commented on issue #21217:
URL: https://github.com/apache/doris/issues/21217#issuecomment-1620174840

   try it in 1.2.5


-- 
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-unsubscribe@doris.apache.org

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


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


[GitHub] [doris] jacktengg commented on issue #21217: [Bug] doris发送错误的fieldpacket,导致mysql驱动将数据库的largeInt解析成String

Posted by "jacktengg (via GitHub)" <gi...@apache.org>.
jacktengg commented on issue #21217:
URL: https://github.com/apache/doris/issues/21217#issuecomment-1659494113

   Then type mapping you mentioned above is for mapping MySQL data types to Doris data types, not from Doris to MySQL.


-- 
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-unsubscribe@doris.apache.org

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


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


[GitHub] [doris] wxlfight closed issue #21217: [Bug] doris发送错误的fieldpacket,导致mysql驱动将数据库的largeInt解析成String

Posted by "wxlfight (via GitHub)" <gi...@apache.org>.
wxlfight closed issue #21217: [Bug] doris发送错误的fieldpacket,导致mysql驱动将数据库的largeInt解析成String
URL: https://github.com/apache/doris/issues/21217


-- 
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-unsubscribe@doris.apache.org

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


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


[GitHub] [doris] wxlfight commented on issue #21217: [Bug] doris发送错误的fieldpacket,导致mysql驱动将数据库的largeInt解析成String

Posted by "wxlfight (via GitHub)" <gi...@apache.org>.
wxlfight commented on issue #21217:
URL: https://github.com/apache/doris/issues/21217#issuecomment-1674153289

   #22835 has fix this problem


-- 
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-unsubscribe@doris.apache.org

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


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


[GitHub] [doris] wxlfight commented on issue #21217: [Bug] doris发送错误的fieldpacket,导致mysql驱动将数据库的largeInt解析成String

Posted by "wxlfight (via GitHub)" <gi...@apache.org>.
wxlfight commented on issue #21217:
URL: https://github.com/apache/doris/issues/21217#issuecomment-1612349513

   > 
   
   Git : file://40f4eb9bc650@Unknown
   
   Version : doris-1.2.1-rc01
   
   BuildInfo : 40f4eb9bc650
   
   BuildTime : Sat, 31 Dec 2022 13:46:08 UTC


-- 
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-unsubscribe@doris.apache.org

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


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


[GitHub] [doris] stalary commented on issue #21217: [Bug] doris发送错误的fieldpacket,导致mysql驱动将数据库的largeInt解析成String

Posted by "stalary (via GitHub)" <gi...@apache.org>.
stalary commented on issue #21217:
URL: https://github.com/apache/doris/issues/21217#issuecomment-1611437694

   Please show frontends look doris version


-- 
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-unsubscribe@doris.apache.org

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


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


[GitHub] [doris] wxlfight commented on issue #21217: [Bug] doris发送错误的fieldpacket,导致mysql驱动将数据库的largeInt解析成String

Posted by "wxlfight (via GitHub)" <gi...@apache.org>.
wxlfight commented on issue #21217:
URL: https://github.com/apache/doris/issues/21217#issuecomment-1614001450

   > Please show frontends look doris version
   
   Git : file://40f4eb9bc650@Unknown
   
   Version : doris-1.2.1-rc01
   
   BuildInfo : 40f4eb9bc650
   
   BuildTime : Sat, 31 Dec 2022 13:46:08 UTC


-- 
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-unsubscribe@doris.apache.org

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


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


[GitHub] [doris] yiguolei commented on issue #21217: [Bug] doris发送错误的fieldpacket,导致mysql驱动将数据库的largeInt解析成String

Posted by "yiguolei (via GitHub)" <gi...@apache.org>.
yiguolei commented on issue #21217:
URL: https://github.com/apache/doris/issues/21217#issuecomment-1658208400

   It is a very serious problem, we will fix it.


-- 
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-unsubscribe@doris.apache.org

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


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