Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. 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

    XMLWordPrintable

Details

    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]>

      Attachments

        Activity

          People

            bertrandop Olivier Bertrand
            Tuco Tuco
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.