SQLGetInfo returning HP Database for SQL_DBMS_NAME
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Trafodion |
Fix Committed
|
High
|
Daniel Lu |
Bug Description
SQLGetInfo returns "HP Database" for SQL_DBMS_NAME on Linux. It returns Trafodion on Windows.
[trafodion@n007 gentests]$ getdbname
Connected
SQL_DBMS_NAME : HP Database
SQL_DATABASE_NAME : TRAFODION
Done
Test code:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <iostream>
#include <sql.h>
#include <sqlext.h>
int main( )
{
SQLHENV hEnv = SQL_NULL_HENV;
SQLHDBC hDbc = SQL_NULL_HDBC;
SQLHSTMT hStmt = SQL_NULL_HSTMT;
SQLRETURN rc = SQL_SUCCESS;
rc = SQLAllocHandle(
if (!SQL_SUCCEEDED
{
puts ("Failed to allocate env");
return (1);
}
rc = SQLSetEnvAttr(hEnv, SQL_ATTR_
if (!SQL_SUCCEEDED
{
puts ("Failed to set odbc version");
return (1);
}
rc = SQLAllocHandle(
if(!SQL_
{
puts ("Failed to allocate dbc");
return (1);
}
rc = SQLConnect(hDbc, (SQLCHAR *) "traf", SQL_NTS, (SQLCHAR *) "a", SQL_NTS, (SQLCHAR *) "a", SQL_NTS);
if(!SQL_
{
puts ("Failed to connect");
return (1);
}
puts("Connected");
SQLCHAR Obuff[128];
int bufferSize = 128;
rc = SQLGetInfo(hDbc, SQL_DBMS_NAME, Obuff, (SQLSMALLINT)
if(!SQL_
{
puts ("SQLGetInfo failed");
return (1);
}
printf ("SQL_DBMS_NAME : %s\n", Obuff);
rc = SQLGetInfo(hDbc, SQL_DATABASE_NAME, Obuff, (SQLSMALLINT)
if(!SQL_
{
puts ("SQLGetInfo failed");
return (1);
}
printf ("SQL_DATABASE_NAME : %s\n", Obuff);
rc = SQLDisconnect(
if (rc != SQL_SUCCESS)
if(!SQL_
{
puts ("Failed to disconnect");
return (1);
}
rc = SQLFreeHandle(
if (rc != SQL_SUCCESS)
if(!SQL_
{
puts ("Failed to free dbc");
return (1);
}
rc = SQLFreeHandle(
if (rc == SQL_SUCCESS)
if(!SQL_
{
puts ("Failed to free env");
return (1);
}
puts ("Done");
return (0);
}
Changed in trafodion: | |
assignee: | nobody → Daniel Lu (ping-lu) |
Changed in trafodion: | |
status: | New → In Progress |
Changed in trafodion: | |
status: | In Progress → Fix Committed |