Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-5351

ConnectSE: ODBC: MSSQL: A SELECT from a CATFUNC=Columns table returns an error

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Not a Bug
    • Affects Version/s: 10.0.10
    • Fix Version/s: 10.0.11
    • Component/s: None
    • Labels:

      Description

      Run the following SQL script against an MS SQL Server data source:

      mysql> drop table if exists t1;
      Query OK, 0 rows affected (0.00 sec)
      
      mysql> create table t1 engine=connect table_type=odbc connection='DSN=ms-amazon;UID=sa;PWD=mypw2013' catfunc=Columns;
      Query OK, 0 rows affected (0.05 sec)
      
      mysql> select * from t1;
      ERROR 1296 (HY000): Got error 174 '[FreeTDS][SQL Server]Procedure or function 'sp_columns' expects parameter '@table_name', which was n' from CONNECT
      

      The expected result (instead of this error) is to return rows with the information
      about all columns of all tables existing in this data source .

      Additionally, the error message is cut, which makes it confusing.
      The entire error message is printed in the server error log:

      [FreeTDS][SQL Server]Procedure or function 'sp_columns' expects parameter '@table_name', which was not supplied.
      OpenTable: [FreeTDS][SQL Server]Procedure or function 'sp_columns' expects parameter '@table_name', which was not supplied.
      

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            bertrandop Olivier Bertrand added a comment -

            To my knowledge, the MS SQL server is the only one that does not accept a columns query without table name.

            Show
            bertrandop Olivier Bertrand added a comment - To my knowledge, the MS SQL server is the only one that does not accept a columns query without table name.
            Hide
            bertrandop Olivier Bertrand added a comment -

            The documentation will tell about this potential issue. It is perhaps possible to specify a table name of '%' to avoid the error but I cannot test it not having MS SQL Server installed on my machines.
            Please let me know if it proves to be a fix.

            Show
            bertrandop Olivier Bertrand added a comment - The documentation will tell about this potential issue. It is perhaps possible to specify a table name of '%' to avoid the error but I cannot test it not having MS SQL Server installed on my machines. Please let me know if it proves to be a fix.

              People

              • Assignee:
                bertrandop Olivier Bertrand
                Reporter:
                bar Alexander Barkov
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: