[MDEV-8561] CONNECT return value of NULL from SQL Server ODBC tables for rows that has a value of 0 from a column of type decimal Created: 2015-07-29  Updated: 2015-07-30  Resolved: 2015-07-30

Status: Closed
Project: MariaDB Server
Component/s: Storage Engine - Connect
Affects Version/s: 10.0.20
Fix Version/s: 10.0.21, 10.1.7

Type: Bug Priority: Major
Reporter: Tuco Assignee: Olivier Bertrand
Resolution: Fixed Votes: 0
Labels: connect-engine
Environment:

Windows Server 2008R2, MS SQL Server 2012



 Description   

In 10.0.20 CONNECT will return the value NULL for rows that has value of 0 from SQL Server ODBC table from column of type decimal.

This did not happen in 10.0.17

I create a table on SQL Server and populate it with one row of value 0

create table t_dec_test(col1 decimal(10, 3))
 
insert into t_dec_test
values (0)

Behavior in 10.0.20

Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 8
Server version: 10.0.20-MariaDB-log mariadb.org binary distribution
 
Copyright (c) 2000, 2015, Oracle, MariaDB Corporation Ab and others.
 
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
 
MariaDB [(none)]> use util
Database changed
MariaDB [util]> create table t_dec_test
    -> ENGINE=CONNECT CONNECTION='DSN=DEV;uid=user;pwd=password' `TABLE_TYPE`='ODBC'
    -> \G
Query OK, 0 rows affected (0.09 sec)
 
MariaDB [util]> select * from t_dec_test\G
*************************** 1. row ***************************
col1: NULL
1 row in set (0.03 sec)
 
MariaDB [util]> show create table t_dec_test\G
*************************** 1. row ***************************
       Table: t_dec_test
Create Table: CREATE TABLE `t_dec_test` (
  `col1` decimal(12,3) DEFAULT NULL
) ENGINE=CONNECT DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci CONNECTION='DSN=DEV;uid=user;pwd=password' `TABLE_TYPE`='ODBC'
1 row in set (0.00 sec)
 
MariaDB [util]>

Behavior in 10.0.17

Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 5
Server version: 10.0.17-MariaDB mariadb.org binary distribution
 
Copyright (c) 2000, 2015, Oracle, MariaDB Corporation Ab and others.
 
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
 
MariaDB [(none)]> use util;
Database changed
MariaDB [util]> create table t_dec_test
    -> ENGINE=CONNECT CONNECTION='DSN=DEV;uid=user;pwd=password' `TABLE_TYPE`='ODBC'\G
Query OK, 0 rows affected (0.06 sec)
 
MariaDB [util]> select * from t_dec_test\G
*************************** 1. row ***************************
col1: 0.000
1 row in set (0.04 sec)
 
MariaDB [util]> show create table t_dec_test\G
*************************** 1. row ***************************
       Table: t_dec_test
Create Table: CREATE TABLE `t_dec_test` (
  `col1` decimal(10,3) DEFAULT NULL
) ENGINE=CONNECT DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci CONNECTION='DSN=DEV;uid=user;pwd=password' `TABLE_TYPE`='ODBC'
1 row in set (0.00 sec)
 
MariaDB [util]>



 Comments   
Comment by Olivier Bertrand [ 2015-07-30 ]

This was not specific to the SQL Server nor the decimal type. It concerned all ODBC tables.
It was a regression bug fixed by removing a wrong recent patch.

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