Uploaded image for project: 'CUBRID APIs'
  1. CUBRID APIs
  2. APIS-538

[ODBC] A problem of the returned value of OdbcConnection.DataSource property

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: ODBC-Apricot
    • Fix Version/s: ODBC-Aprium
    • Component/s: ODBC
    • Labels:
      None
    • Environment:

      OS: Windows XP 32bit
      Server Version:CUBRID 9.1 (9.1.0.0212) (64bit release build for linux_gnu) (Mar 14 2013 00:16:33)
      Driver Version: ODBC driver 9.1 (20130422-14175366)

      Description

      • Brief:
        • OdbcConnection.DataSource propobaly returns an incorrect value
      • Test Code:
         
        
               [Test, Description("Test for OdbcConnection Property DataSource")]
                public void ConnectProperties_DataSource()
                {
                    string dataSource = "CUBRID";
                    string strConn = "Driver={CUBRID Driver};db_name=odbc_test;uid=dba;server=10.34.64.57;port=33037;fetch_size=100";
                    OdbcConnection connCubrid = new OdbcConnection(strConn);
                    connCubrid.Open();
                    Assert.AreEqual(dataSource, connCubrid.DataSource);
                    connCubrid.Close();
                }
        
        
      • Result: Expected: "CUBRID" But was: "10.34.64.57"
      • Description:
        • The current ODBC driver returns OdbcConnection.DataSource property with the value of the Server Location (i.e. server ip address), But according to the MSDN specification: "the DataSource property is equivalent to calling the ODBC function SQLGetInfo with the InfoType parameter set to SQL_SERVER_NAME" (e.g. the Access ODBC returns "ACCESS" as the DataSource property, so the CUBRID ODBC may returns "CUBRID" as the DataSource Property)

        Activity

        Hide
        cn15800 谢韦华[Bert] added a comment -

        we set value of SQL_SERVER_NAME as database's ip currently.

        case SQL_SERVER_NAME:
        if (conn->server == NULL)

        { buf[0] = '\0'; }

        else

        { strcpy (buf,conn->server); }

        unsigned char *server; /* odbc server address */

        Show
        cn15800 谢韦华[Bert] added a comment - we set value of SQL_SERVER_NAME as database's ip currently. case SQL_SERVER_NAME: if (conn->server == NULL) { buf[0] = '\0'; } else { strcpy (buf,conn->server); } unsigned char *server; /* odbc server address */
        Hide
        ryin005 Ray Yin added a comment -

        Fixed on ODBC-9.1.0 (20130502-17531383)

        Show
        ryin005 Ray Yin added a comment - Fixed on ODBC-9.1.0 (20130502-17531383)

          People

          • Assignee:
            cn15800 谢韦华[Bert]
            Reporter:
            ryin005 Ray Yin
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: