[MDEV-10111] Connect engine: remote smallint unsigned is considered as smallint signed Created: 2016-05-24  Updated: 2016-06-03  Resolved: 2016-06-02

Status: Closed
Project: MariaDB Server
Component/s: Storage Engine - Connect
Affects Version/s: 10.1.14, 10.0, 10.1
Fix Version/s: 10.1.16, 10.0.27

Type: Bug Priority: Major
Reporter: Sergey Antonyuk Assignee: Olivier Bertrand
Resolution: Fixed Votes: 0
Labels: None
Environment:

3.2.0-4-amd64 #1 SMP Debian 3.2.35-2 x86_64 GNU/Linux



 Description   

Scenario:

Remote Server
---------------------

CREATE TABLE a (
`v` SMALLINT UNSIGNED
) Engine = InnoDB;

INSERT INTO `a` VALUES(40000);

Local server
---------------------

CREATE TABLE `rem` ENGINE=CONNECT DEFAULT CHARSET=utf8 `TABLE_TYPE`='MYSQL' `DBNAME`='db' `SRCDEF`='SELECT * FROM a' `OPTION_LIST`='host=127.0.0.1,port=3301,user=user,password=password';

SELECT * FROM `rem`;

Actual result
-----------------------
0) `rem` table has `v` column defined as smallint(5).
1) Value of `v` column is selected as 32767 instead of 40000.
2) Out of range warning is generated.

Desired result
-------------------------
0) `rem` table has `v` column defined as smallint unsigned.
1) Value of `v` column is selected as 40000.



 Comments   
Comment by Elena Stepanova [ 2016-05-27 ]

Thanks for the report.

Comment by Olivier Bertrand [ 2016-06-02 ]

This was not specific to smallint but to creating a MySQL table with srcdef.
A turnaround, waiting to a fixed version, is to manually specifiy the column definitions.

Generated at Thu Feb 08 07:39:45 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.