diff options
Diffstat (limited to 'storage/ndb/src/old_files/client/odbc/driver')
83 files changed, 7542 insertions, 0 deletions
diff --git a/storage/ndb/src/old_files/client/odbc/driver/Func.data b/storage/ndb/src/old_files/client/odbc/driver/Func.data new file mode 100644 index 00000000000..c32671e1135 --- /dev/null +++ b/storage/ndb/src/old_files/client/odbc/driver/Func.data @@ -0,0 +1,2822 @@ +$func = { + SQLAllocConnect => { + type => 'SQLRETURN', + name => 'SQLAllocConnect', + param => [ + { + type => 'SQLHENV', + ptr => 0, + name => 'EnvironmentHandle', + index => 0, + }, + { + type => 'SQLHDBC', + ptr => 1, + name => 'ConnectionHandle', + index => 1, + }, + ], + odbcver => 'ODBCVER >= 0x0000', + }, + SQLAllocEnv => { + type => 'SQLRETURN', + name => 'SQLAllocEnv', + param => [ + { + type => 'SQLHENV', + ptr => 1, + name => 'EnvironmentHandle', + index => 0, + }, + ], + odbcver => 'ODBCVER >= 0x0000', + }, + SQLAllocHandle => { + type => 'SQLRETURN', + name => 'SQLAllocHandle', + param => [ + { + type => 'SQLSMALLINT', + ptr => 0, + name => 'HandleType', + index => 0, + }, + { + type => 'SQLHANDLE', + ptr => 0, + name => 'InputHandle', + index => 1, + }, + { + type => 'SQLHANDLE', + ptr => 1, + name => 'OutputHandle', + index => 2, + }, + ], + odbcver => 'ODBCVER >= 0x0300', + }, + SQLAllocHandleStd => { + type => 'SQLRETURN', + name => 'SQLAllocHandleStd', + param => [ + { + type => 'SQLSMALLINT', + ptr => 0, + name => 'fHandleType', + index => 0, + }, + { + type => 'SQLHANDLE', + ptr => 0, + name => 'hInput', + index => 1, + }, + { + type => 'SQLHANDLE', + ptr => 1, + name => 'phOutput', + index => 2, + }, + ], + odbcver => 'ODBCVER >= 0x0300', + }, + SQLAllocStmt => { + type => 'SQLRETURN', + name => 'SQLAllocStmt', + param => [ + { + type => 'SQLHDBC', + ptr => 0, + name => 'ConnectionHandle', + index => 0, + }, + { + type => 'SQLHSTMT', + ptr => 1, + name => 'StatementHandle', + index => 1, + }, + ], + odbcver => 'ODBCVER >= 0x0000', + }, + SQLBindCol => { + type => 'SQLRETURN', + name => 'SQLBindCol', + param => [ + { + type => 'SQLHSTMT', + ptr => 0, + name => 'StatementHandle', + index => 0, + }, + { + type => 'SQLUSMALLINT', + ptr => 0, + name => 'ColumnNumber', + index => 1, + }, + { + type => 'SQLSMALLINT', + ptr => 0, + name => 'TargetType', + index => 2, + }, + { + type => 'SQLPOINTER', + ptr => 0, + name => 'TargetValue', + index => 3, + }, + { + type => 'SQLINTEGER', + ptr => 0, + name => 'BufferLength', + index => 4, + }, + { + type => 'SQLINTEGER', + ptr => 1, + name => 'StrLen_or_Ind', + index => 5, + }, + ], + odbcver => 'ODBCVER >= 0x0000', + }, + SQLBindParam => { + type => 'SQLRETURN', + name => 'SQLBindParam', + param => [ + { + type => 'SQLHSTMT', + ptr => 0, + name => 'StatementHandle', + index => 0, + }, + { + type => 'SQLUSMALLINT', + ptr => 0, + name => 'ParameterNumber', + index => 1, + }, + { + type => 'SQLSMALLINT', + ptr => 0, + name => 'ValueType', + index => 2, + }, + { + type => 'SQLSMALLINT', + ptr => 0, + name => 'ParameterType', + index => 3, + }, + { + type => 'SQLUINTEGER', + ptr => 0, + name => 'LengthPrecision', + index => 4, + }, + { + type => 'SQLSMALLINT', + ptr => 0, + name => 'ParameterScale', + index => 5, + }, + { + type => 'SQLPOINTER', + ptr => 0, + name => 'ParameterValue', + index => 6, + }, + { + type => 'SQLINTEGER', + ptr => 1, + name => 'StrLen_or_Ind', + index => 7, + }, + ], + odbcver => 'ODBCVER >= 0x0300', + }, + SQLBindParameter => { + type => 'SQLRETURN', + name => 'SQLBindParameter', + param => [ + { + type => 'SQLHSTMT', + ptr => 0, + name => 'hstmt', + index => 0, + }, + { + type => 'SQLUSMALLINT', + ptr => 0, + name => 'ipar', + index => 1, + }, + { + type => 'SQLSMALLINT', + ptr => 0, + name => 'fParamType', + index => 2, + }, + { + type => 'SQLSMALLINT', + ptr => 0, + name => 'fCType', + index => 3, + }, + { + type => 'SQLSMALLINT', + ptr => 0, + name => 'fSqlType', + index => 4, + }, + { + type => 'SQLUINTEGER', + ptr => 0, + name => 'cbColDef', + index => 5, + }, + { + type => 'SQLSMALLINT', + ptr => 0, + name => 'ibScale', + index => 6, + }, + { + type => 'SQLPOINTER', + ptr => 0, + name => 'rgbValue', + index => 7, + }, + { + type => 'SQLINTEGER', + ptr => 0, + name => 'cbValueMax', + index => 8, + }, + { + type => 'SQLINTEGER', + ptr => 1, + name => 'pcbValue', + index => 9, + }, + ], + odbcver => 'ODBCVER >= 0x0000', + }, + SQLBrowseConnect => { + type => 'SQLRETURN', + name => 'SQLBrowseConnect', + param => [ + { + type => 'SQLHDBC', + ptr => 0, + name => 'hdbc', + index => 0, + }, + { + type => 'SQLCHAR', + ptr => 1, + name => 'szConnStrIn', + index => 1, + }, + { + type => 'SQLSMALLINT', + ptr => 0, + name => 'cbConnStrIn', + index => 2, + }, + { + type => 'SQLCHAR', + ptr => 1, + name => 'szConnStrOut', + index => 3, + }, + { + type => 'SQLSMALLINT', + ptr => 0, + name => 'cbConnStrOutMax', + index => 4, + }, + { + type => 'SQLSMALLINT', + ptr => 1, + name => 'pcbConnStrOut', + index => 5, + }, + ], + odbcver => 'ODBCVER >= 0x0000', + }, + SQLBulkOperations => { + type => 'SQLRETURN', + name => 'SQLBulkOperations', + param => [ + { + type => 'SQLHSTMT', + ptr => 0, + name => 'StatementHandle', + index => 0, + }, + { + type => 'SQLSMALLINT', + ptr => 0, + name => 'Operation', + index => 1, + }, + ], + odbcver => 'ODBCVER >= 0x0300', + }, + SQLCancel => { + type => 'SQLRETURN', + name => 'SQLCancel', + param => [ + { + type => 'SQLHSTMT', + ptr => 0, + name => 'StatementHandle', + index => 0, + }, + ], + odbcver => 'ODBCVER >= 0x0000', + }, + SQLCloseCursor => { + type => 'SQLRETURN', + name => 'SQLCloseCursor', + param => [ + { + type => 'SQLHSTMT', + ptr => 0, + name => 'StatementHandle', + index => 0, + }, + ], + odbcver => 'ODBCVER >= 0x0300', + }, + SQLColAttribute => { + type => 'SQLRETURN', + name => 'SQLColAttribute', + param => [ + { + type => 'SQLHSTMT', + ptr => 0, + name => 'StatementHandle', + index => 0, + }, + { + type => 'SQLUSMALLINT', + ptr => 0, + name => 'ColumnNumber', + index => 1, + }, + { + type => 'SQLUSMALLINT', + ptr => 0, + name => 'FieldIdentifier', + index => 2, + }, + { + type => 'SQLPOINTER', + ptr => 0, + name => 'CharacterAttribute', + index => 3, + }, + { + type => 'SQLSMALLINT', + ptr => 0, + name => 'BufferLength', + index => 4, + }, + { + type => 'SQLSMALLINT', + ptr => 1, + name => 'StringLength', + index => 5, + }, + { + type => 'SQLPOINTER', + ptr => 0, + name => 'NumericAttribute', + index => 6, + }, + ], + odbcver => 'ODBCVER >= 0x0300', + }, + SQLColAttributes => { + type => 'SQLRETURN', + name => 'SQLColAttributes', + param => [ + { + type => 'SQLHSTMT', + ptr => 0, + name => 'hstmt', + index => 0, + }, + { + type => 'SQLUSMALLINT', + ptr => 0, + name => 'icol', + index => 1, + }, + { + type => 'SQLUSMALLINT', + ptr => 0, + name => 'fDescType', + index => 2, + }, + { + type => 'SQLPOINTER', + ptr => 0, + name => 'rgbDesc', + index => 3, + }, + { + type => 'SQLSMALLINT', + ptr => 0, + name => 'cbDescMax', + index => 4, + }, + { + type => 'SQLSMALLINT', + ptr => 1, + name => 'pcbDesc', + index => 5, + }, + { + type => 'SQLINTEGER', + ptr => 1, + name => 'pfDesc', + index => 6, + }, + ], + odbcver => 'ODBCVER >= 0x0000', + }, + SQLColumnPrivileges => { + type => 'SQLRETURN', + name => 'SQLColumnPrivileges', + param => [ + { + type => 'SQLHSTMT', + ptr => 0, + name => 'hstmt', + index => 0, + }, + { + type => 'SQLCHAR', + ptr => 1, + name => 'szCatalogName', + index => 1, + }, + { + type => 'SQLSMALLINT', + ptr => 0, + name => 'cbCatalogName', + index => 2, + }, + { + type => 'SQLCHAR', + ptr => 1, + name => 'szSchemaName', + index => 3, + }, + { + type => 'SQLSMALLINT', + ptr => 0, + name => 'cbSchemaName', + index => 4, + }, + { + type => 'SQLCHAR', + ptr => 1, + name => 'szTableName', + index => 5, + }, + { + type => 'SQLSMALLINT', + ptr => 0, + name => 'cbTableName', + index => 6, + }, + { + type => 'SQLCHAR', + ptr => 1, + name => 'szColumnName', + index => 7, + }, + { + type => 'SQLSMALLINT', + ptr => 0, + name => 'cbColumnName', + index => 8, + }, + ], + odbcver => 'ODBCVER >= 0x0000', + }, + SQLColumns => { + type => 'SQLRETURN', + name => 'SQLColumns', + param => [ + { + type => 'SQLHSTMT', + ptr => 0, + name => 'StatementHandle', + index => 0, + }, + { + type => 'SQLCHAR', + ptr => 1, + name => 'CatalogName', + index => 1, + }, + { + type => 'SQLSMALLINT', + ptr => 0, + name => 'NameLength1', + index => 2, + }, + { + type => 'SQLCHAR', + ptr => 1, + name => 'SchemaName', + index => 3, + }, + { + type => 'SQLSMALLINT', + ptr => 0, + name => 'NameLength2', + index => 4, + }, + { + type => 'SQLCHAR', + ptr => 1, + name => 'TableName', + index => 5, + }, + { + type => 'SQLSMALLINT', + ptr => 0, + name => 'NameLength3', + index => 6, + }, + { + type => 'SQLCHAR', + ptr => 1, + name => 'ColumnName', + index => 7, + }, + { + type => 'SQLSMALLINT', + ptr => 0, + name => 'NameLength4', + index => 8, + }, + ], + odbcver => 'ODBCVER >= 0x0000', + }, + SQLConnect => { + type => 'SQLRETURN', + name => 'SQLConnect', + param => [ + { + type => 'SQLHDBC', + ptr => 0, + name => 'ConnectionHandle', + index => 0, + }, + { + type => 'SQLCHAR', + ptr => 1, + name => 'ServerName', + index => 1, + }, + { + type => 'SQLSMALLINT', + ptr => 0, + name => 'NameLength1', + index => 2, + }, + { + type => 'SQLCHAR', + ptr => 1, + name => 'UserName', + index => 3, + }, + { + type => 'SQLSMALLINT', + ptr => 0, + name => 'NameLength2', + index => 4, + }, + { + type => 'SQLCHAR', + ptr => 1, + name => 'Authentication', + index => 5, + }, + { + type => 'SQLSMALLINT', + ptr => 0, + name => 'NameLength3', + index => 6, + }, + ], + odbcver => 'ODBCVER >= 0x0000', + }, + SQLCopyDesc => { + type => 'SQLRETURN', + name => 'SQLCopyDesc', + param => [ + { + type => 'SQLHDESC', + ptr => 0, + name => 'SourceDescHandle', + index => 0, + }, + { + type => 'SQLHDESC', + ptr => 0, + name => 'TargetDescHandle', + index => 1, + }, + ], + odbcver => 'ODBCVER >= 0x0300', + }, + SQLDataSources => { + type => 'SQLRETURN', + name => 'SQLDataSources', + param => [ + { + type => 'SQLHENV', + ptr => 0, + name => 'EnvironmentHandle', + index => 0, + }, + { + type => 'SQLUSMALLINT', + ptr => 0, + name => 'Direction', + index => 1, + }, + { + type => 'SQLCHAR', + ptr => 1, + name => 'ServerName', + index => 2, + }, + { + type => 'SQLSMALLINT', + ptr => 0, + name => 'BufferLength1', + index => 3, + }, + { + type => 'SQLSMALLINT', + ptr => 1, + name => 'NameLength1', + index => 4, + }, + { + type => 'SQLCHAR', + ptr => 1, + name => 'Description', + index => 5, + }, + { + type => 'SQLSMALLINT', + ptr => 0, + name => 'BufferLength2', + index => 6, + }, + { + type => 'SQLSMALLINT', + ptr => 1, + name => 'NameLength2', + index => 7, + }, + ], + odbcver => 'ODBCVER >= 0x0000', + }, + SQLDescribeCol => { + type => 'SQLRETURN', + name => 'SQLDescribeCol', + param => [ + { + type => 'SQLHSTMT', + ptr => 0, + name => 'StatementHandle', + index => 0, + }, + { + type => 'SQLUSMALLINT', + ptr => 0, + name => 'ColumnNumber', + index => 1, + }, + { + type => 'SQLCHAR', + ptr => 1, + name => 'ColumnName', + index => 2, + }, + { + type => 'SQLSMALLINT', + ptr => 0, + name => 'BufferLength', + index => 3, + }, + { + type => 'SQLSMALLINT', + ptr => 1, + name => 'NameLength', + index => 4, + }, + { + type => 'SQLSMALLINT', + ptr => 1, + name => 'DataType', + index => 5, + }, + { + type => 'SQLUINTEGER', + ptr => 1, + name => 'ColumnSize', + index => 6, + }, + { + type => 'SQLSMALLINT', + ptr => 1, + name => 'DecimalDigits', + index => 7, + }, + { + type => 'SQLSMALLINT', + ptr => 1, + name => 'Nullable', + index => 8, + }, + ], + odbcver => 'ODBCVER >= 0x0000', + }, + SQLDescribeParam => { + type => 'SQLRETURN', + name => 'SQLDescribeParam', + param => [ + { + type => 'SQLHSTMT', + ptr => 0, + name => 'hstmt', + index => 0, + }, + { + type => 'SQLUSMALLINT', + ptr => 0, + name => 'ipar', + index => 1, + }, + { + type => 'SQLSMALLINT', + ptr => 1, + name => 'pfSqlType', + index => 2, + }, + { + type => 'SQLUINTEGER', + ptr => 1, + name => 'pcbParamDef', + index => 3, + }, + { + type => 'SQLSMALLINT', + ptr => 1, + name => 'pibScale', + index => 4, + }, + { + type => 'SQLSMALLINT', + ptr => 1, + name => 'pfNullable', + index => 5, + }, + ], + odbcver => 'ODBCVER >= 0x0000', + }, + SQLDisconnect => { + type => 'SQLRETURN', + name => 'SQLDisconnect', + param => [ + { + type => 'SQLHDBC', + ptr => 0, + name => 'ConnectionHandle', + index => 0, + }, + ], + odbcver => 'ODBCVER >= 0x0000', + }, + SQLDriverConnect => { + type => 'SQLRETURN', + name => 'SQLDriverConnect', + param => [ + { + type => 'SQLHDBC', + ptr => 0, + name => 'hdbc', + index => 0, + }, + { + type => 'SQLHWND', + ptr => 0, + name => 'hwnd', + index => 1, + }, + { + type => 'SQLCHAR', + ptr => 1, + name => 'szConnStrIn', + index => 2, + }, + { + type => 'SQLSMALLINT', + ptr => 0, + name => 'cbConnStrIn', + index => 3, + }, + { + type => 'SQLCHAR', + ptr => 1, + name => 'szConnStrOut', + index => 4, + }, + { + type => 'SQLSMALLINT', + ptr => 0, + name => 'cbConnStrOutMax', + index => 5, + }, + { + type => 'SQLSMALLINT', + ptr => 1, + name => 'pcbConnStrOut', + index => 6, + }, + { + type => 'SQLUSMALLINT', + ptr => 0, + name => 'fDriverCompletion', + index => 7, + }, + ], + odbcver => 'ODBCVER >= 0x0000', + }, + SQLDrivers => { + type => 'SQLRETURN', + name => 'SQLDrivers', + param => [ + { + type => 'SQLHENV', + ptr => 0, + name => 'henv', + index => 0, + }, + { + type => 'SQLUSMALLINT', + ptr => 0, + name => 'fDirection', + index => 1, + }, + { + type => 'SQLCHAR', + ptr => 1, + name => 'szDriverDesc', + index => 2, + }, + { + type => 'SQLSMALLINT', + ptr => 0, + name => 'cbDriverDescMax', + index => 3, + }, + { + type => 'SQLSMALLINT', + ptr => 1, + name => 'pcbDriverDesc', + index => 4, + }, + { + type => 'SQLCHAR', + ptr => 1, + name => 'szDriverAttributes', + index => 5, + }, + { + type => 'SQLSMALLINT', + ptr => 0, + name => 'cbDrvrAttrMax', + index => 6, + }, + { + type => 'SQLSMALLINT', + ptr => 1, + name => 'pcbDrvrAttr', + index => 7, + }, + ], + odbcver => 'ODBCVER >= 0x0000', + }, + SQLEndTran => { + type => 'SQLRETURN', + name => 'SQLEndTran', + param => [ + { + type => 'SQLSMALLINT', + ptr => 0, + name => 'HandleType', + index => 0, + }, + { + type => 'SQLHANDLE', + ptr => 0, + name => 'Handle', + index => 1, + }, + { + type => 'SQLSMALLINT', + ptr => 0, + name => 'CompletionType', + index => 2, + }, + ], + odbcver => 'ODBCVER >= 0x0300', + }, + SQLError => { + type => 'SQLRETURN', + name => 'SQLError', + param => [ + { + type => 'SQLHENV', + ptr => 0, + name => 'EnvironmentHandle', + index => 0, + }, + { + type => 'SQLHDBC', + ptr => 0, + name => 'ConnectionHandle', + index => 1, + }, + { + type => 'SQLHSTMT', + ptr => 0, + name => 'StatementHandle', + index => 2, + }, + { + type => 'SQLCHAR', + ptr => 1, + name => 'Sqlstate', + index => 3, + }, + { + type => 'SQLINTEGER', + ptr => 1, + name => 'NativeError', + index => 4, + }, + { + type => 'SQLCHAR', + ptr => 1, + name => 'MessageText', + index => 5, + }, + { + type => 'SQLSMALLINT', + ptr => 0, + name => 'BufferLength', + index => 6, + }, + { + type => 'SQLSMALLINT', + ptr => 1, + name => 'TextLength', + index => 7, + }, + ], + odbcver => 'ODBCVER >= 0x0000', + }, + SQLExecDirect => { + type => 'SQLRETURN', + name => 'SQLExecDirect', + param => [ + { + type => 'SQLHSTMT', + ptr => 0, + name => 'StatementHandle', + index => 0, + }, + { + type => 'SQLCHAR', + ptr => 1, + name => 'StatementText', + index => 1, + }, + { + type => 'SQLINTEGER', + ptr => 0, + name => 'TextLength', + index => 2, + }, + ], + odbcver => 'ODBCVER >= 0x0000', + }, + SQLExecute => { + type => 'SQLRETURN', + name => 'SQLExecute', + param => [ + { + type => 'SQLHSTMT', + ptr => 0, + name => 'StatementHandle', + index => 0, + }, + ], + odbcver => 'ODBCVER >= 0x0000', + }, + SQLExtendedFetch => { + type => 'SQLRETURN', + name => 'SQLExtendedFetch', + param => [ + { + type => 'SQLHSTMT', + ptr => 0, + name => 'hstmt', + index => 0, + }, + { + type => 'SQLUSMALLINT', + ptr => 0, + name => 'fFetchType', + index => 1, + }, + { + type => 'SQLINTEGER', + ptr => 0, + name => 'irow', + index => 2, + }, + { + type => 'SQLUINTEGER', + ptr => 1, + name => 'pcrow', + index => 3, + }, + { + type => 'SQLUSMALLINT', + ptr => 1, + name => 'rgfRowStatus', + index => 4, + }, + ], + odbcver => 'ODBCVER >= 0x0000', + }, + SQLFetch => { + type => 'SQLRETURN', + name => 'SQLFetch', + param => [ + { + type => 'SQLHSTMT', + ptr => 0, + name => 'StatementHandle', + index => 0, + }, + ], + odbcver => 'ODBCVER >= 0x0000', + }, + SQLFetchScroll => { + type => 'SQLRETURN', + name => 'SQLFetchScroll', + param => [ + { + type => 'SQLHSTMT', + ptr => 0, + name => 'StatementHandle', + index => 0, + }, + { + type => 'SQLSMALLINT', + ptr => 0, + name => 'FetchOrientation', + index => 1, + }, + { + type => 'SQLINTEGER', + ptr => 0, + name => 'FetchOffset', + index => 2, + }, + ], + odbcver => 'ODBCVER >= 0x0300', + }, + SQLForeignKeys => { + type => 'SQLRETURN', + name => 'SQLForeignKeys', + param => [ + { + type => 'SQLHSTMT', + ptr => 0, + name => 'hstmt', + index => 0, + }, + { + type => 'SQLCHAR', + ptr => 1, + name => 'szPkCatalogName', + index => 1, + }, + { + type => 'SQLSMALLINT', + ptr => 0, + name => 'cbPkCatalogName', + index => 2, + }, + { + type => 'SQLCHAR', + ptr => 1, + name => 'szPkSchemaName', + index => 3, + }, + { + type => 'SQLSMALLINT', + ptr => 0, + name => 'cbPkSchemaName', + index => 4, + }, + { + type => 'SQLCHAR', + ptr => 1, + name => 'szPkTableName', + index => 5, + }, + { + type => 'SQLSMALLINT', + ptr => 0, + name => 'cbPkTableName', + index => 6, + }, + { + type => 'SQLCHAR', + ptr => 1, + name => 'szFkCatalogName', + index => 7, + }, + { + type => 'SQLSMALLINT', + ptr => 0, + name => 'cbFkCatalogName', + index => 8, + }, + { + type => 'SQLCHAR', + ptr => 1, + name => 'szFkSchemaName', + index => 9, + }, + { + type => 'SQLSMALLINT', + ptr => 0, + name => 'cbFkSchemaName', + index => 10, + }, + { + type => 'SQLCHAR', + ptr => 1, + name => 'szFkTableName', + index => 11, + }, + { + type => 'SQLSMALLINT', + ptr => 0, + name => 'cbFkTableName', + index => 12, + }, + ], + odbcver => 'ODBCVER >= 0x0000', + }, + SQLFreeConnect => { + type => 'SQLRETURN', + name => 'SQLFreeConnect', + param => [ + { + type => 'SQLHDBC', + ptr => 0, + name => 'ConnectionHandle', + index => 0, + }, + ], + odbcver => 'ODBCVER >= 0x0000', + }, + SQLFreeEnv => { + type => 'SQLRETURN', + name => 'SQLFreeEnv', + param => [ + { + type => 'SQLHENV', + ptr => 0, + name => 'EnvironmentHandle', + index => 0, + }, + ], + odbcver => 'ODBCVER >= 0x0000', + }, + SQLFreeHandle => { + type => 'SQLRETURN', + name => 'SQLFreeHandle', + param => [ + { + type => 'SQLSMALLINT', + ptr => 0, + name => 'HandleType', + index => 0, + }, + { + type => 'SQLHANDLE', + ptr => 0, + name => 'Handle', + index => 1, + }, + ], + odbcver => 'ODBCVER >= 0x0300', + }, + SQLFreeStmt => { + type => 'SQLRETURN', + name => 'SQLFreeStmt', + param => [ + { + type => 'SQLHSTMT', + ptr => 0, + name => 'StatementHandle', + index => 0, + }, + { + type => 'SQLUSMALLINT', + ptr => 0, + name => 'Option', + index => 1, + }, + ], + odbcver => 'ODBCVER >= 0x0000', + }, + SQLGetConnectAttr => { + type => 'SQLRETURN', + name => 'SQLGetConnectAttr', + param => [ + { + type => 'SQLHDBC', + ptr => 0, + name => 'ConnectionHandle', + index => 0, + }, + { + type => 'SQLINTEGER', + ptr => 0, + name => 'Attribute', + index => 1, + }, + { + type => 'SQLPOINTER', + ptr => 0, + name => 'Value', + index => 2, + }, + { + type => 'SQLINTEGER', + ptr => 0, + name => 'BufferLength', + index => 3, + }, + { + type => 'SQLINTEGER', + ptr => 1, + name => 'StringLength', + index => 4, + }, + ], + odbcver => 'ODBCVER >= 0x0300', + }, + SQLGetConnectOption => { + type => 'SQLRETURN', + name => 'SQLGetConnectOption', + param => [ + { + type => 'SQLHDBC', + ptr => 0, + name => 'ConnectionHandle', + index => 0, + }, + { + type => 'SQLUSMALLINT', + ptr => 0, + name => 'Option', + index => 1, + }, + { + type => 'SQLPOINTER', + ptr => 0, + name => 'Value', + index => 2, + }, + ], + odbcver => 'ODBCVER >= 0x0000', + }, + SQLGetCursorName => { + type => 'SQLRETURN', + name => 'SQLGetCursorName', + param => [ + { + type => 'SQLHSTMT', + ptr => 0, + name => 'StatementHandle', + index => 0, + }, + { + type => 'SQLCHAR', + ptr => 1, + name => 'CursorName', + index => 1, + }, + { + type => 'SQLSMALLINT', + ptr => 0, + name => 'BufferLength', + index => 2, + }, + { + type => 'SQLSMALLINT', + ptr => 1, + name => 'NameLength', + index => 3, + }, + ], + odbcver => 'ODBCVER >= 0x0000', + }, + SQLGetData => { + type => 'SQLRETURN', + name => 'SQLGetData', + param => [ + { + type => 'SQLHSTMT', + ptr => 0, + name => 'StatementHandle', + index => 0, + }, + { + type => 'SQLUSMALLINT', + ptr => 0, + name => 'ColumnNumber', + index => 1, + }, + { + type => 'SQLSMALLINT', + ptr => 0, + name => 'TargetType', + index => 2, + }, + { + type => 'SQLPOINTER', + ptr => 0, + name => 'TargetValue', + index => 3, + }, + { + type => 'SQLINTEGER', + ptr => 0, + name => 'BufferLength', + index => 4, + }, + { + type => 'SQLINTEGER', + ptr => 1, + name => 'StrLen_or_Ind', + index => 5, + }, + ], + odbcver => 'ODBCVER >= 0x0000', + }, + SQLGetDescField => { + type => 'SQLRETURN', + name => 'SQLGetDescField', + param => [ + { + type => 'SQLHDESC', + ptr => 0, + name => 'DescriptorHandle', + index => 0, + }, + { + type => 'SQLSMALLINT', + ptr => 0, + name => 'RecNumber', + index => 1, + }, + { + type => 'SQLSMALLINT', + ptr => 0, + name => 'FieldIdentifier', + index => 2, + }, + { + type => 'SQLPOINTER', + ptr => 0, + name => 'Value', + index => 3, + }, + { + type => 'SQLINTEGER', + ptr => 0, + name => 'BufferLength', + index => 4, + }, + { + type => 'SQLINTEGER', + ptr => 1, + name => 'StringLength', + index => 5, + }, + ], + odbcver => 'ODBCVER >= 0x0300', + }, + SQLGetDescRec => { + type => 'SQLRETURN', + name => 'SQLGetDescRec', + param => [ + { + type => 'SQLHDESC', + ptr => 0, + name => 'DescriptorHandle', + index => 0, + }, + { + type => 'SQLSMALLINT', + ptr => 0, + name => 'RecNumber', + index => 1, + }, + { + type => 'SQLCHAR', + ptr => 1, + name => 'Name', + index => 2, + }, + { + type => 'SQLSMALLINT', + ptr => 0, + name => 'BufferLength', + index => 3, + }, + { + type => 'SQLSMALLINT', + ptr => 1, + name => 'StringLength', + index => 4, + }, + { + type => 'SQLSMALLINT', + ptr => 1, + name => 'Type', + index => 5, + }, + { + type => 'SQLSMALLINT', + ptr => 1, + name => 'SubType', + index => 6, + }, + { + type => 'SQLINTEGER', + ptr => 1, + name => 'Length', + index => 7, + }, + { + type => 'SQLSMALLINT', + ptr => 1, + name => 'Precision', + index => 8, + }, + { + type => 'SQLSMALLINT', + ptr => 1, + name => 'Scale', + index => 9, + }, + { + type => 'SQLSMALLINT', + ptr => 1, + name => 'Nullable', + index => 10, + }, + ], + odbcver => 'ODBCVER >= 0x0300', + }, + SQLGetDiagField => { + type => 'SQLRETURN', + name => 'SQLGetDiagField', + param => [ + { + type => 'SQLSMALLINT', + ptr => 0, + name => 'HandleType', + index => 0, + }, + { + type => 'SQLHANDLE', + ptr => 0, + name => 'Handle', + index => 1, + }, + { + type => 'SQLSMALLINT', + ptr => 0, + name => 'RecNumber', + index => 2, + }, + { + type => 'SQLSMALLINT', + ptr => 0, + name => 'DiagIdentifier', + index => 3, + }, + { + type => 'SQLPOINTER', + ptr => 0, + name => 'DiagInfo', + index => 4, + }, + { + type => 'SQLSMALLINT', + ptr => 0, + name => 'BufferLength', + index => 5, + }, + { + type => 'SQLSMALLINT', + ptr => 1, + name => 'StringLength', + index => 6, + }, + ], + odbcver => 'ODBCVER >= 0x0300', + }, + SQLGetDiagRec => { + type => 'SQLRETURN', + name => 'SQLGetDiagRec', + param => [ + { + type => 'SQLSMALLINT', + ptr => 0, + name => 'HandleType', + index => 0, + }, + { + type => 'SQLHANDLE', + ptr => 0, + name => 'Handle', + index => 1, + }, + { + type => 'SQLSMALLINT', + ptr => 0, + name => 'RecNumber', + index => 2, + }, + { + type => 'SQLCHAR', + ptr => 1, + name => 'Sqlstate', + index => 3, + }, + { + type => 'SQLINTEGER', + ptr => 1, + name => 'NativeError', + index => 4, + }, + { + type => 'SQLCHAR', + ptr => 1, + name => 'MessageText', + index => 5, + }, + { + type => 'SQLSMALLINT', + ptr => 0, + name => 'BufferLength', + index => 6, + }, + { + type => 'SQLSMALLINT', + ptr => 1, + name => 'TextLength', + index => 7, + }, + ], + odbcver => 'ODBCVER >= 0x0300', + }, + SQLGetEnvAttr => { + type => 'SQLRETURN', + name => 'SQLGetEnvAttr', + param => [ + { + type => 'SQLHENV', + ptr => 0, + name => 'EnvironmentHandle', + index => 0, + }, + { + type => 'SQLINTEGER', + ptr => 0, + name => 'Attribute', + index => 1, + }, + { + type => 'SQLPOINTER', + ptr => 0, + name => 'Value', + index => 2, + }, + { + type => 'SQLINTEGER', + ptr => 0, + name => 'BufferLength', + index => 3, + }, + { + type => 'SQLINTEGER', + ptr => 1, + name => 'StringLength', + index => 4, + }, + ], + odbcver => 'ODBCVER >= 0x0300', + }, + SQLGetFunctions => { + type => 'SQLRETURN', + name => 'SQLGetFunctions', + param => [ + { + type => 'SQLHDBC', + ptr => 0, + name => 'ConnectionHandle', + index => 0, + }, + { + type => 'SQLUSMALLINT', + ptr => 0, + name => 'FunctionId', + index => 1, + }, + { + type => 'SQLUSMALLINT', + ptr => 1, + name => 'Supported', + index => 2, + }, + ], + odbcver => 'ODBCVER >= 0x0000', + }, + SQLGetInfo => { + type => 'SQLRETURN', + name => 'SQLGetInfo', + param => [ + { + type => 'SQLHDBC', + ptr => 0, + name => 'ConnectionHandle', + index => 0, + }, + { + type => 'SQLUSMALLINT', + ptr => 0, + name => 'InfoType', + index => 1, + }, + { + type => 'SQLPOINTER', + ptr => 0, + name => 'InfoValue', + index => 2, + }, + { + type => 'SQLSMALLINT', + ptr => 0, + name => 'BufferLength', + index => 3, + }, + { + type => 'SQLSMALLINT', + ptr => 1, + name => 'StringLength', + index => 4, + }, + ], + odbcver => 'ODBCVER >= 0x0000', + }, + SQLGetStmtAttr => { + type => 'SQLRETURN', + name => 'SQLGetStmtAttr', + param => [ + { + type => 'SQLHSTMT', + ptr => 0, + name => 'StatementHandle', + index => 0, + }, + { + type => 'SQLINTEGER', + ptr => 0, + name => 'Attribute', + index => 1, + }, + { + type => 'SQLPOINTER', + ptr => 0, + name => 'Value', + index => 2, + }, + { + type => 'SQLINTEGER', + ptr => 0, + name => 'BufferLength', + index => 3, + }, + { + type => 'SQLINTEGER', + ptr => 1, + name => 'StringLength', + index => 4, + }, + ], + odbcver => 'ODBCVER >= 0x0300', + }, + SQLGetStmtOption => { + type => 'SQLRETURN', + name => 'SQLGetStmtOption', + param => [ + { + type => 'SQLHSTMT', + ptr => 0, + name => 'StatementHandle', + index => 0, + }, + { + type => 'SQLUSMALLINT', + ptr => 0, + name => 'Option', + index => 1, + }, + { + type => 'SQLPOINTER', + ptr => 0, + name => 'Value', + index => 2, + }, + ], + odbcver => 'ODBCVER >= 0x0000', + }, + SQLGetTypeInfo => { + type => 'SQLRETURN', + name => 'SQLGetTypeInfo', + param => [ + { + type => 'SQLHSTMT', + ptr => 0, + name => 'StatementHandle', + index => 0, + }, + { + type => 'SQLSMALLINT', + ptr => 0, + name => 'DataType', + index => 1, + }, + ], + odbcver => 'ODBCVER >= 0x0000', + }, + SQLMoreResults => { + type => 'SQLRETURN', + name => 'SQLMoreResults', + param => [ + { + type => 'SQLHSTMT', + ptr => 0, + name => 'hstmt', + index => 0, + }, + ], + odbcver => 'ODBCVER >= 0x0000', + }, + SQLNativeSql => { + type => 'SQLRETURN', + name => 'SQLNativeSql', + param => [ + { + type => 'SQLHDBC', + ptr => 0, + name => 'hdbc', + index => 0, + }, + { + type => 'SQLCHAR', + ptr => 1, + name => 'szSqlStrIn', + index => 1, + }, + { + type => 'SQLINTEGER', + ptr => 0, + name => 'cbSqlStrIn', + index => 2, + }, + { + type => 'SQLCHAR', + ptr => 1, + name => 'szSqlStr', + index => 3, + }, + { + type => 'SQLINTEGER', + ptr => 0, + name => 'cbSqlStrMax', + index => 4, + }, + { + type => 'SQLINTEGER', + ptr => 1, + name => 'pcbSqlStr', + index => 5, + }, + ], + odbcver => 'ODBCVER >= 0x0000', + }, + SQLNumParams => { + type => 'SQLRETURN', + name => 'SQLNumParams', + param => [ + { + type => 'SQLHSTMT', + ptr => 0, + name => 'hstmt', + index => 0, + }, + { + type => 'SQLSMALLINT', + ptr => 1, + name => 'pcpar', + index => 1, + }, + ], + odbcver => 'ODBCVER >= 0x0000', + }, + SQLNumResultCols => { + type => 'SQLRETURN', + name => 'SQLNumResultCols', + param => [ + { + type => 'SQLHSTMT', + ptr => 0, + name => 'StatementHandle', + index => 0, + }, + { + type => 'SQLSMALLINT', + ptr => 1, + name => 'ColumnCount', + index => 1, + }, + ], + odbcver => 'ODBCVER >= 0x0000', + }, + SQLParamData => { + type => 'SQLRETURN', + name => 'SQLParamData', + param => [ + { + type => 'SQLHSTMT', + ptr => 0, + name => 'StatementHandle', + index => 0, + }, + { + type => 'SQLPOINTER', + ptr => 1, + name => 'Value', + index => 1, + }, + ], + odbcver => 'ODBCVER >= 0x0000', + }, + SQLParamOptions => { + type => 'SQLRETURN', + name => 'SQLParamOptions', + param => [ + { + type => 'SQLHSTMT', + ptr => 0, + name => 'hstmt', + index => 0, + }, + { + type => 'SQLUINTEGER', + ptr => 0, + name => 'crow', + index => 1, + }, + { + type => 'SQLUINTEGER', + ptr => 1, + name => 'pirow', + index => 2, + }, + ], + odbcver => 'ODBCVER >= 0x0000', + }, + SQLPrepare => { + type => 'SQLRETURN', + name => 'SQLPrepare', + param => [ + { + type => 'SQLHSTMT', + ptr => 0, + name => 'StatementHandle', + index => 0, + }, + { + type => 'SQLCHAR', + ptr => 1, + name => 'StatementText', + index => 1, + }, + { + type => 'SQLINTEGER', + ptr => 0, + name => 'TextLength', + index => 2, + }, + ], + odbcver => 'ODBCVER >= 0x0000', + }, + SQLPrimaryKeys => { + type => 'SQLRETURN', + name => 'SQLPrimaryKeys', + param => [ + { + type => 'SQLHSTMT', + ptr => 0, + name => 'hstmt', + index => 0, + }, + { + type => 'SQLCHAR', + ptr => 1, + name => 'szCatalogName', + index => 1, + }, + { + type => 'SQLSMALLINT', + ptr => 0, + name => 'cbCatalogName', + index => 2, + }, + { + type => 'SQLCHAR', + ptr => 1, + name => 'szSchemaName', + index => 3, + }, + { + type => 'SQLSMALLINT', + ptr => 0, + name => 'cbSchemaName', + index => 4, + }, + { + type => 'SQLCHAR', + ptr => 1, + name => 'szTableName', + index => 5, + }, + { + type => 'SQLSMALLINT', + ptr => 0, + name => 'cbTableName', + index => 6, + }, + ], + odbcver => 'ODBCVER >= 0x0000', + }, + SQLProcedureColumns => { + type => 'SQLRETURN', + name => 'SQLProcedureColumns', + param => [ + { + type => 'SQLHSTMT', + ptr => 0, + name => 'hstmt', + index => 0, + }, + { + type => 'SQLCHAR', + ptr => 1, + name => 'szCatalogName', + index => 1, + }, + { + type => 'SQLSMALLINT', + ptr => 0, + name => 'cbCatalogName', + index => 2, + }, + { + type => 'SQLCHAR', + ptr => 1, + name => 'szSchemaName', + index => 3, + }, + { + type => 'SQLSMALLINT', + ptr => 0, + name => 'cbSchemaName', + index => 4, + }, + { + type => 'SQLCHAR', + ptr => 1, + name => 'szProcName', + index => 5, + }, + { + type => 'SQLSMALLINT', + ptr => 0, + name => 'cbProcName', + index => 6, + }, + { + type => 'SQLCHAR', + ptr => 1, + name => 'szColumnName', + index => 7, + }, + { + type => 'SQLSMALLINT', + ptr => 0, + name => 'cbColumnName', + index => 8, + }, + ], + odbcver => 'ODBCVER >= 0x0000', + }, + SQLProcedures => { + type => 'SQLRETURN', + name => 'SQLProcedures', + param => [ + { + type => 'SQLHSTMT', + ptr => 0, + name => 'hstmt', + index => 0, + }, + { + type => 'SQLCHAR', + ptr => 1, + name => 'szCatalogName', + index => 1, + }, + { + type => 'SQLSMALLINT', + ptr => 0, + name => 'cbCatalogName', + index => 2, + }, + { + type => 'SQLCHAR', + ptr => 1, + name => 'szSchemaName', + index => 3, + }, + { + type => 'SQLSMALLINT', + ptr => 0, + name => 'cbSchemaName', + index => 4, + }, + { + type => 'SQLCHAR', + ptr => 1, + name => 'szProcName', + index => 5, + }, + { + type => 'SQLSMALLINT', + ptr => 0, + name => 'cbProcName', + index => 6, + }, + ], + odbcver => 'ODBCVER >= 0x0000', + }, + SQLPutData => { + type => 'SQLRETURN', + name => 'SQLPutData', + param => [ + { + type => 'SQLHSTMT', + ptr => 0, + name => 'StatementHandle', + index => 0, + }, + { + type => 'SQLPOINTER', + ptr => 0, + name => 'Data', + index => 1, + }, + { + type => 'SQLINTEGER', + ptr => 0, + name => 'StrLen_or_Ind', + index => 2, + }, + ], + odbcver => 'ODBCVER >= 0x0000', + }, + SQLRowCount => { + type => 'SQLRETURN', + name => 'SQLRowCount', + param => [ + { + type => 'SQLHSTMT', + ptr => 0, + name => 'StatementHandle', + index => 0, + }, + { + type => 'SQLINTEGER', + ptr => 1, + name => 'RowCount', + index => 1, + }, + ], + odbcver => 'ODBCVER >= 0x0000', + }, + SQLSetConnectAttr => { + type => 'SQLRETURN', + name => 'SQLSetConnectAttr', + param => [ + { + type => 'SQLHDBC', + ptr => 0, + name => 'ConnectionHandle', + index => 0, + }, + { + type => 'SQLINTEGER', + ptr => 0, + name => 'Attribute', + index => 1, + }, + { + type => 'SQLPOINTER', + ptr => 0, + name => 'Value', + index => 2, + }, + { + type => 'SQLINTEGER', + ptr => 0, + name => 'StringLength', + index => 3, + }, + ], + odbcver => 'ODBCVER >= 0x0300', + }, + SQLSetConnectOption => { + type => 'SQLRETURN', + name => 'SQLSetConnectOption', + param => [ + { + type => 'SQLHDBC', + ptr => 0, + name => 'ConnectionHandle', + index => 0, + }, + { + type => 'SQLUSMALLINT', + ptr => 0, + name => 'Option', + index => 1, + }, + { + type => 'SQLUINTEGER', + ptr => 0, + name => 'Value', + index => 2, + }, + ], + odbcver => 'ODBCVER >= 0x0000', + }, + SQLSetCursorName => { + type => 'SQLRETURN', + name => 'SQLSetCursorName', + param => [ + { + type => 'SQLHSTMT', + ptr => 0, + name => 'StatementHandle', + index => 0, + }, + { + type => 'SQLCHAR', + ptr => 1, + name => 'CursorName', + index => 1, + }, + { + type => 'SQLSMALLINT', + ptr => 0, + name => 'NameLength', + index => 2, + }, + ], + odbcver => 'ODBCVER >= 0x0000', + }, + SQLSetDescField => { + type => 'SQLRETURN', + name => 'SQLSetDescField', + param => [ + { + type => 'SQLHDESC', + ptr => 0, + name => 'DescriptorHandle', + index => 0, + }, + { + type => 'SQLSMALLINT', + ptr => 0, + name => 'RecNumber', + index => 1, + }, + { + type => 'SQLSMALLINT', + ptr => 0, + name => 'FieldIdentifier', + index => 2, + }, + { + type => 'SQLPOINTER', + ptr => 0, + name => 'Value', + index => 3, + }, + { + type => 'SQLINTEGER', + ptr => 0, + name => 'BufferLength', + index => 4, + }, + ], + odbcver => 'ODBCVER >= 0x0300', + }, + SQLSetDescRec => { + type => 'SQLRETURN', + name => 'SQLSetDescRec', + param => [ + { + type => 'SQLHDESC', + ptr => 0, + name => 'DescriptorHandle', + index => 0, + }, + { + type => 'SQLSMALLINT', + ptr => 0, + name => 'RecNumber', + index => 1, + }, + { + type => 'SQLSMALLINT', + ptr => 0, + name => 'Type', + index => 2, + }, + { + type => 'SQLSMALLINT', + ptr => 0, + name => 'SubType', + index => 3, + }, + { + type => 'SQLINTEGER', + ptr => 0, + name => 'Length', + index => 4, + }, + { + type => 'SQLSMALLINT', + ptr => 0, + name => 'Precision', + index => 5, + }, + { + type => 'SQLSMALLINT', + ptr => 0, + name => 'Scale', + index => 6, + }, + { + type => 'SQLPOINTER', + ptr => 0, + name => 'Data', + index => 7, + }, + { + type => 'SQLINTEGER', + ptr => 1, + name => 'StringLength', + index => 8, + }, + { + type => 'SQLINTEGER', + ptr => 1, + name => 'Indicator', + index => 9, + }, + ], + odbcver => 'ODBCVER >= 0x0300', + }, + SQLSetEnvAttr => { + type => 'SQLRETURN', + name => 'SQLSetEnvAttr', + param => [ + { + type => 'SQLHENV', + ptr => 0, + name => 'EnvironmentHandle', + index => 0, + }, + { + type => 'SQLINTEGER', + ptr => 0, + name => 'Attribute', + index => 1, + }, + { + type => 'SQLPOINTER', + ptr => 0, + name => 'Value', + index => 2, + }, + { + type => 'SQLINTEGER', + ptr => 0, + name => 'StringLength', + index => 3, + }, + ], + odbcver => 'ODBCVER >= 0x0300', + }, + SQLSetParam => { + type => 'SQLRETURN', + name => 'SQLSetParam', + param => [ + { + type => 'SQLHSTMT', + ptr => 0, + name => 'StatementHandle', + index => 0, + }, + { + type => 'SQLUSMALLINT', + ptr => 0, + name => 'ParameterNumber', + index => 1, + }, + { + type => 'SQLSMALLINT', + ptr => 0, + name => 'ValueType', + index => 2, + }, + { + type => 'SQLSMALLINT', + ptr => 0, + name => 'ParameterType', + index => 3, + }, + { + type => 'SQLUINTEGER', + ptr => 0, + name => 'LengthPrecision', + index => 4, + }, + { + type => 'SQLSMALLINT', + ptr => 0, + name => 'ParameterScale', + index => 5, + }, + { + type => 'SQLPOINTER', + ptr => 0, + name => 'ParameterValue', + index => 6, + }, + { + type => 'SQLINTEGER', + ptr => 1, + name => 'StrLen_or_Ind', + index => 7, + }, + ], + odbcver => 'ODBCVER >= 0x0000', + }, + SQLSetPos => { + type => 'SQLRETURN', + name => 'SQLSetPos', + param => [ + { + type => 'SQLHSTMT', + ptr => 0, + name => 'hstmt', + index => 0, + }, + { + type => 'SQLUSMALLINT', + ptr => 0, + name => 'irow', + index => 1, + }, + { + type => 'SQLUSMALLINT', + ptr => 0, + name => 'fOption', + index => 2, + }, + { + type => 'SQLUSMALLINT', + ptr => 0, + name => 'fLock', + index => 3, + }, + ], + odbcver => 'ODBCVER >= 0x0000', + }, + SQLSetScrollOptions => { + type => 'SQLRETURN', + name => 'SQLSetScrollOptions', + param => [ + { + type => 'SQLHSTMT', + ptr => 0, + name => 'hstmt', + index => 0, + }, + { + type => 'SQLUSMALLINT', + ptr => 0, + name => 'fConcurrency', + index => 1, + }, + { + type => 'SQLINTEGER', + ptr => 0, + name => 'crowKeyset', + index => 2, + }, + { + type => 'SQLUSMALLINT', + ptr => 0, + name => 'crowRowset', + index => 3, + }, + ], + odbcver => 'ODBCVER >= 0x0000', + }, + SQLSetStmtAttr => { + type => 'SQLRETURN', + name => 'SQLSetStmtAttr', + param => [ + { + type => 'SQLHSTMT', + ptr => 0, + name => 'StatementHandle', + index => 0, + }, + { + type => 'SQLINTEGER', + ptr => 0, + name => 'Attribute', + index => 1, + }, + { + type => 'SQLPOINTER', + ptr => 0, + name => 'Value', + index => 2, + }, + { + type => 'SQLINTEGER', + ptr => 0, + name => 'StringLength', + index => 3, + }, + ], + odbcver => 'ODBCVER >= 0x0300', + }, + SQLSetStmtOption => { + type => 'SQLRETURN', + name => 'SQLSetStmtOption', + param => [ + { + type => 'SQLHSTMT', + ptr => 0, + name => 'StatementHandle', + index => 0, + }, + { + type => 'SQLUSMALLINT', + ptr => 0, + name => 'Option', + index => 1, + }, + { + type => 'SQLUINTEGER', + ptr => 0, + name => 'Value', + index => 2, + }, + ], + odbcver => 'ODBCVER >= 0x0000', + }, + SQLSpecialColumns => { + type => 'SQLRETURN', + name => 'SQLSpecialColumns', + param => [ + { + type => 'SQLHSTMT', + ptr => 0, + name => 'StatementHandle', + index => 0, + }, + { + type => 'SQLUSMALLINT', + ptr => 0, + name => 'IdentifierType', + index => 1, + }, + { + type => 'SQLCHAR', + ptr => 1, + name => 'CatalogName', + index => 2, + }, + { + type => 'SQLSMALLINT', + ptr => 0, + name => 'NameLength1', + index => 3, + }, + { + type => 'SQLCHAR', + ptr => 1, + name => 'SchemaName', + index => 4, + }, + { + type => 'SQLSMALLINT', + ptr => 0, + name => 'NameLength2', + index => 5, + }, + { + type => 'SQLCHAR', + ptr => 1, + name => 'TableName', + index => 6, + }, + { + type => 'SQLSMALLINT', + ptr => 0, + name => 'NameLength3', + index => 7, + }, + { + type => 'SQLUSMALLINT', + ptr => 0, + name => 'Scope', + index => 8, + }, + { + type => 'SQLUSMALLINT', + ptr => 0, + name => 'Nullable', + index => 9, + }, + ], + odbcver => 'ODBCVER >= 0x0000', + }, + SQLStatistics => { + type => 'SQLRETURN', + name => 'SQLStatistics', + param => [ + { + type => 'SQLHSTMT', + ptr => 0, + name => 'StatementHandle', + index => 0, + }, + { + type => 'SQLCHAR', + ptr => 1, + name => 'CatalogName', + index => 1, + }, + { + type => 'SQLSMALLINT', + ptr => 0, + name => 'NameLength1', + index => 2, + }, + { + type => 'SQLCHAR', + ptr => 1, + name => 'SchemaName', + index => 3, + }, + { + type => 'SQLSMALLINT', + ptr => 0, + name => 'NameLength2', + index => 4, + }, + { + type => 'SQLCHAR', + ptr => 1, + name => 'TableName', + index => 5, + }, + { + type => 'SQLSMALLINT', + ptr => 0, + name => 'NameLength3', + index => 6, + }, + { + type => 'SQLUSMALLINT', + ptr => 0, + name => 'Unique', + index => 7, + }, + { + type => 'SQLUSMALLINT', + ptr => 0, + name => 'Reserved', + index => 8, + }, + ], + odbcver => 'ODBCVER >= 0x0000', + }, + SQLTablePrivileges => { + type => 'SQLRETURN', + name => 'SQLTablePrivileges', + param => [ + { + type => 'SQLHSTMT', + ptr => 0, + name => 'hstmt', + index => 0, + }, + { + type => 'SQLCHAR', + ptr => 1, + name => 'szCatalogName', + index => 1, + }, + { + type => 'SQLSMALLINT', + ptr => 0, + name => 'cbCatalogName', + index => 2, + }, + { + type => 'SQLCHAR', + ptr => 1, + name => 'szSchemaName', + index => 3, + }, + { + type => 'SQLSMALLINT', + ptr => 0, + name => 'cbSchemaName', + index => 4, + }, + { + type => 'SQLCHAR', + ptr => 1, + name => 'szTableName', + index => 5, + }, + { + type => 'SQLSMALLINT', + ptr => 0, + name => 'cbTableName', + index => 6, + }, + ], + odbcver => 'ODBCVER >= 0x0000', + }, + SQLTables => { + type => 'SQLRETURN', + name => 'SQLTables', + param => [ + { + type => 'SQLHSTMT', + ptr => 0, + name => 'StatementHandle', + index => 0, + }, + { + type => 'SQLCHAR', + ptr => 1, + name => 'CatalogName', + index => 1, + }, + { + type => 'SQLSMALLINT', + ptr => 0, + name => 'NameLength1', + index => 2, + }, + { + type => 'SQLCHAR', + ptr => 1, + name => 'SchemaName', + index => 3, + }, + { + type => 'SQLSMALLINT', + ptr => 0, + name => 'NameLength2', + index => 4, + }, + { + type => 'SQLCHAR', + ptr => 1, + name => 'TableName', + index => 5, + }, + { + type => 'SQLSMALLINT', + ptr => 0, + name => 'NameLength3', + index => 6, + }, + { + type => 'SQLCHAR', + ptr => 1, + name => 'TableType', + index => 7, + }, + { + type => 'SQLSMALLINT', + ptr => 0, + name => 'NameLength4', + index => 8, + }, + ], + odbcver => 'ODBCVER >= 0x0000', + }, + SQLTransact => { + type => 'SQLRETURN', + name => 'SQLTransact', + param => [ + { + type => 'SQLHENV', + ptr => 0, + name => 'EnvironmentHandle', + index => 0, + }, + { + type => 'SQLHDBC', + ptr => 0, + name => 'ConnectionHandle', + index => 1, + }, + { + type => 'SQLUSMALLINT', + ptr => 0, + name => 'CompletionType', + index => 2, + }, + ], + odbcver => 'ODBCVER >= 0x0000', + }, +}; diff --git a/storage/ndb/src/old_files/client/odbc/driver/Func.pl b/storage/ndb/src/old_files/client/odbc/driver/Func.pl new file mode 100644 index 00000000000..1064a6a6c6e --- /dev/null +++ b/storage/ndb/src/old_files/client/odbc/driver/Func.pl @@ -0,0 +1,352 @@ +# + +use strict; +select(STDOUT); +$| = 1; +use vars qw($func); + +my $action = shift; +my @args = @ARGV; +if (! $action) { + print <<END; +usage: perl $0 <data|name|code|move> ... +data -unixodbc -- write new Func.data to stdout +name [-[no]auto -type] [suffix] -- list function names +code -- write auto/*.cpp +diff -- diff against auto/*.cpp +move -- move auto/*.cpp to . +functab -- write struct entiries for SQLGetFunctions +END + exit(0); +} + +# indents +my $i1 = " " x (1*4); +my $i2 = " " x (2*4); +my $i3 = " " x (3*4); +my $i4 = " " x (4*4); + +if ($action eq 'data') { + my @entry = (); + while (@args) { + my $file = shift(@args); + if ($file eq '-unixodbc') { + unshift(@args, </usr/local/include/{sql,sqlext}.h>); + next; + } + if ($file eq '-iodbc') { + unshift(@args, </usr/local/opt/iODBC/include/{sql,sqlext}.h>); + next; + } + warn "read $file\n"; + open(F, "<$file") || die "$file: $!"; + my $text = undef; + my $odbcver = undef; + while ($_ = <F>) { + chomp; + if (/^\s*$/) { + next; + } + if (/^\s*#\s*if\s+(.*\bODBCVER\b.*)$/) { + $odbcver = $1; + $odbcver =~ s/^\s+|\s+$//g; + $odbcver =~ s/^\(+|\)+$//g; + next; + } + if (/^\s*#\s*endif\b/) { + $odbcver = undef; + next; + } + if (/^\s*SQLRETURN\b/) { + $text = ""; + } + if (defined($text)) { + $text .= $_; + if (/;\s*$/) { + push(@entry, { + text => $text, + odbcver => $odbcver || 'ODBCVER >= 0x0000', + }); + $text = undef; + } + } + } + close(F); + } + warn "@{[ scalar @entry ]} entries\n"; + $func = {}; + for my $e (@entry) { + my $text = $e->{text}; + $text =~ s!/\*.+?\*/!!g; + $text =~ s/^\s+|\s+$//g; + $text =~ s/\s\s*/\040/g; + $text =~ /^(SQLRETURN)\s+(SQL_API\s+)?(\w+)\s*\((.*)\)\s*;/ + or warn "discard: $_\n", next; + my $type = $1; + my $name = $3; + my $body = $4; + my $f = {}; + $f->{type} = $type; + $f->{name} = $name; + my @body = split(/,/, $body); + my $param = []; + for my $s (@body) { + $s =~ s/^\s+|\s+$//g; + my($ptype, $pptr, $pname); + if ($s =~ /^(\w+)\s+(\w+)$/) { + $ptype = $1; + $pptr = 0; + $pname = $2; + } elsif ($s =~ /^(\w+)\s*\*\s*(\w+)$/) { + $ptype = $1; + $pptr = 1; + $pname = $2; + } else { + warn "discard: $name: param $s\n"; + $param = undef; + last; + } + my $pindex = scalar @$param; + push(@$param, { + type => $ptype, + ptr => $pptr, + name => $pname, + index => $pindex, + }); + } + $param or next; + $f->{param} = $param; + $f->{odbcver} = $e->{odbcver}; + $func->{$name} + and warn "duplicate: $name\n", next; + $func->{$name} = $f; + } + print "\$func = {\n"; + for my $name (sort keys %$func) { + my $f = $func->{$name}; + print "${i1}$name => {\n"; + print "${i2}type => '$f->{type}',\n"; + print "${i2}name => '$f->{name}',\n"; + print "${i2}param => [\n"; + for my $p (@{$f->{param}}) { + print "${i3}\{\n"; + print "${i4}type => '$p->{type}',\n"; + print "${i4}ptr => $p->{ptr},\n"; + print "${i4}name => '$p->{name}',\n"; + print "${i4}index => $p->{index},\n"; + print "${i3}\},\n"; + } + print "${i2}],\n"; + print "${i2}odbcver => '$f->{odbcver}',\n"; + print "${i1}},\n"; + } + printf "};\n"; + $action = undef; +} + +if ($action eq 'name') { + my %functab = (); # bit in FuncTab + my $functab = "../handles/FuncTab.cpp"; + if (! open(F, "<$functab")) { + warn "$functab: $!"; + } else { + while ($_ = <F>) { + if (/SQL_API_([A-Z]+)[\s,]*([01])/) { + defined $functab{$1} and die "$_"; + $functab{$1} = $2; + } + } + close(F); + } + require './Func.data'; + my $auto = 1; + my $noauto = 1; + my $type = 0; + while ($args[0] =~ /^-(\w+)$/) { + $noauto = 0 if $1 eq 'auto'; + $auto = 0 if $1 eq 'noauto'; + $type = 1 if $1 eq 'type'; + shift(@args); + } + my $suffix = shift(@args); + for my $name (sort keys %$func) { + my $f = $func->{$name}; + local $/ = undef; + my($x1); + if (open(F, "<$name.cpp")) { + $x1 = <F>; + close(F); + if ($x1 =~ /\bauto_$name\b/) { + $auto || next; + print "A " if $type; + } else { + $noauto || next; + print "- " if $type; + } + if ($type) { + my $y = $functab{uc $name}; + $y = "?" if $y !~ /^[01]$/; + print "$y "; + my $z = $f->{odbcver}; + $z =~ s/^.*(...)$/$1/; + print "$z "; + } + } + print "$name$suffix\n"; + } + $action = undef; +} + +if ($action eq 'code') { + require './Func.data'; + system("rm -rf auto; mkdir auto"); + for my $name (sort keys %$func) { + my $f = $func->{$name}; + my $file = "auto/$name.cpp"; + open(F, ">$file") || die "$file: $!\n"; + print F "#include \"driver.hpp\"\n"; + print F "\n"; + printf F "#if $f->{odbcver}\n"; + print F "$f->{type} SQL_API\n"; + print F "$f->{name}("; + for my $p (@{$f->{param}}) { + print F "," if $p->{index} > 0; + print F "\n${i1}$p->{type}"; + for (my $i = 0; $i < $p->{ptr}; $i++) { + print F "*"; + } + print F " $p->{name}"; + } + print F ")\n"; + print F "{\n"; + print F "${i1}const char* const sqlFunction = \"$f->{name}\";\n"; + print F "#ifndef auto_$name\n"; + print F "${i1}Ctx ctx;\n"; + print F "${i1}ctx.log(1, \"*** not implemented: %s\", sqlFunction);\n"; + print F "${i1}return SQL_ERROR;\n"; + print F "#else\n"; + my @ihandle = (); + my @ohandle = (); + for my $p (@{$f->{param}}) { + if ($p->{type} =~ /^SQLH(ENV|DBC|STMT|DESC)$/) { + $p->{btype} = lc $1; + my $h = ! $p->{ptr} ? \@ihandle : \@ohandle; + push(@$h, $p); + } + } + if (! @ihandle) { # use root handle instance + push(@ihandle, { + type => 'SQLHROOT', + name => '(SQLHANDLE*)0', + }); + } + for my $p (@ihandle, @ohandle) { + $p->{htype} = "Handle" . (ucfirst lc $p->{btype}); + $p->{hname} = "p" . (ucfirst lc $p->{btype}); + } + if (@ihandle) { + print F "${i1}HandleRoot* const pRoot = HandleRoot::instance();\n"; + } + for my $p (@ihandle) { + print F "${i1}$p->{htype}* $p->{hname} = "; + print F "pRoot->find" . ucfirst($p->{btype}). "($p->{name});\n"; + print F "${i1}if ($p->{hname} == 0)\n"; + print F "${i2}return SQL_INVALID_HANDLE;\n"; + } + { + my $p = $ihandle[0]; + print F "${i1}Ctx& ctx = $p->{hname}->initCtx();\n"; + print F "${i1}ctx.logSqlEnter(sqlFunction);\n"; + } + for my $p (@ohandle) { + print F "${i1}$p->{htype}* $p->{hname} = 0;\n"; + } + { + my $p = $ihandle[0]; + my $fname = $f->{name}; + $fname =~ s/^SQL/sql/; # keep sql prefix + print F "${i1}if (ctx.ok())\n"; + print F "${i2}$p->{hname}->$fname(\n"; + print F "${i3}ctx"; + } + for my $p (@{$f->{param}}) { + if ($p == $ihandle[0]) { + next; + } + print F ","; + print F "\n${i3}"; + if (grep($_ == $p, @ihandle)) { + print F "$p->{hname}"; + } elsif (grep($_ == $p, @ohandle)) { + print F "$p->{name} != 0 ? &$p->{hname} : 0"; + } else { + print F "&" if $p->{ptr} > 0; + print F "$p->{name}"; + } + } + print F "\n${i2});\n"; + for my $p (@ohandle) { + print F "${i1}if ($p->{name} != 0)\n"; + print F "${i2}*$p->{name} = "; + print F "pRoot->from" . ucfirst($p->{btype}) . "($p->{hname});\n"; + } + { + my $p = $ihandle[0]; + print F "${i1}$p->{hname}->saveCtx(ctx);\n"; + } + print F "${i1}ctx.logSqlExit();\n"; + print F "${i1}return ctx.getCode();\n"; + print F "#endif\n"; + print F "}\n"; + print F "#endif // $f->{odbcver}\n"; + close(F); + } + $action = undef; +} + +if ($action eq 'diff' || $action eq 'move') { + require './Func.data'; + for my $name (sort keys %$func) { + local $/ = undef; + my($x1, $x2); + if (open(F, "<$name.cpp")) { + $x1 = <F>; + close(F); + if ($x1 !~ /\bauto_$name\b/) { + warn "$name.cpp: not auto-generated\n" if $action eq 'move'; + next; + } + } + if (! open(F, "<auto/$name.cpp")) { + die "auto/$name.cpp: $!\n"; + } + $x2 = <F>; + close(F); + if ($x1 eq $x2) { + warn "$name: no changes\n" if $action eq 'move'; + next; + } + if ($action eq 'diff') { + print "=" x 40, "\n"; + print "diff $name.cpp auto/", "\n"; + system("diff $name.cpp auto/$name.cpp"); + } else { + rename("auto/$name.cpp", "$name.cpp") + or die "rename $name: $!\n"; + warn "$name: updated\n" if 0; + } + } + $action = undef; +} + +if ($action eq 'functab') { + require './Func.data'; + for my $name (sort keys %$func) { + printf "%4s{%3s%-30s, 0 },\n", "", "", uc "SQL_API_$name"; + } + $action = undef; +} + +$action && die "$action: undefined\n"; + +# vim: set sw=4: diff --git a/storage/ndb/src/old_files/client/odbc/driver/Makefile b/storage/ndb/src/old_files/client/odbc/driver/Makefile new file mode 100644 index 00000000000..62f82371da4 --- /dev/null +++ b/storage/ndb/src/old_files/client/odbc/driver/Makefile @@ -0,0 +1,16 @@ +include .defs.mk + +TYPE = * + +NONPIC_ARCHIVE = N + +PIC_ARCHIVE = Y + +ARCHIVE_TARGET = odbcdriver + +SOURCES = driver.cpp + +SOURCES_EXTRA = $(shell perl Func.pl name .cpp) + +include ../Extra.mk +include $(NDB_TOP)/Epilogue.mk diff --git a/storage/ndb/src/old_files/client/odbc/driver/SQLAllocConnect.cpp b/storage/ndb/src/old_files/client/odbc/driver/SQLAllocConnect.cpp new file mode 100644 index 00000000000..a7ffd8c89d1 --- /dev/null +++ b/storage/ndb/src/old_files/client/odbc/driver/SQLAllocConnect.cpp @@ -0,0 +1,52 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "driver.hpp" + +#if ODBCVER >= 0x0000 +SQLRETURN SQL_API +SQLAllocConnect( + SQLHENV EnvironmentHandle, + SQLHDBC* ConnectionHandle) +{ + driver_enter(SQL_API_SQLALLOCCONNECT); + const char* const sqlFunction = "SQLAllocConnect"; + HandleRoot* const pRoot = HandleRoot::instance(); + HandleEnv* pEnv = pRoot->findEnv(EnvironmentHandle); + if (pEnv == 0) { + driver_exit(SQL_API_SQLALLOCCONNECT); + return SQL_INVALID_HANDLE; + } + Ctx& ctx = *new Ctx; + ctx.logSqlEnter(sqlFunction); + HandleDbc* pDbc = 0; + HandleDbc** ppDbc = 0; + if (ConnectionHandle != 0) + ppDbc = &pDbc; + try { + pEnv->sqlAllocConnect(ctx, ppDbc); + } catch (CtxAssert& ctxAssert) { + ctx.handleEx(ctxAssert); + } + if (ConnectionHandle != 0) + *ConnectionHandle = static_cast<SQLHDBC>(pDbc); + pEnv->saveCtx(ctx); + ctx.logSqlExit(); + SQLRETURN ret = ctx.getCode(); + driver_exit(SQL_API_SQLALLOCCONNECT); + return ret; +} +#endif // ODBCVER >= 0x0000 diff --git a/storage/ndb/src/old_files/client/odbc/driver/SQLAllocEnv.cpp b/storage/ndb/src/old_files/client/odbc/driver/SQLAllocEnv.cpp new file mode 100644 index 00000000000..a62dae61008 --- /dev/null +++ b/storage/ndb/src/old_files/client/odbc/driver/SQLAllocEnv.cpp @@ -0,0 +1,46 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "driver.hpp" + +#if ODBCVER >= 0x0000 +SQLRETURN SQL_API +SQLAllocEnv( + SQLHENV* EnvironmentHandle) +{ + driver_enter(SQL_API_SQLALLOCENV); + const char* const sqlFunction = "SQLAllocEnv"; + HandleRoot* const pRoot = HandleRoot::instance(); + Ctx& ctx = *new Ctx; + ctx.logSqlEnter(sqlFunction); + HandleEnv* pEnv = 0; + HandleEnv** ppEnv = 0; + if (EnvironmentHandle != 0) + ppEnv = &pEnv; + try { + pRoot->sqlAllocEnv(ctx, ppEnv); + } catch (CtxAssert& ctxAssert) { + ctx.handleEx(ctxAssert); + } + if (EnvironmentHandle != 0) + *EnvironmentHandle = static_cast<SQLHENV>(pEnv); + pRoot->saveCtx(ctx); + ctx.logSqlExit(); + SQLRETURN ret = ctx.getCode(); + driver_exit(SQL_API_SQLALLOCENV); + return ret; +} +#endif // ODBCVER >= 0x0000 diff --git a/storage/ndb/src/old_files/client/odbc/driver/SQLAllocHandle.cpp b/storage/ndb/src/old_files/client/odbc/driver/SQLAllocHandle.cpp new file mode 100644 index 00000000000..9daf6ead946 --- /dev/null +++ b/storage/ndb/src/old_files/client/odbc/driver/SQLAllocHandle.cpp @@ -0,0 +1,62 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "driver.hpp" + +#if ODBCVER >= 0x0300 +SQLRETURN SQL_API +SQLAllocHandle( + SQLSMALLINT HandleType, + SQLHANDLE InputHandle, + SQLHANDLE* OutputHandle) +{ + driver_enter(SQL_API_SQLALLOCHANDLE); + const char* const sqlFunction = "SQLAllocHandle"; + HandleRoot* const pRoot = HandleRoot::instance(); + SQLSMALLINT parentType = pRoot->findParentType(HandleType); + if (parentType == -1) { + driver_exit(SQL_API_SQLALLOCHANDLE); + return SQL_INVALID_HANDLE; + } + HandleBase* pParent = pRoot->findBase(parentType, InputHandle); + if (pParent == 0) { + driver_exit(SQL_API_SQLALLOCHANDLE); + return SQL_INVALID_HANDLE; + } + Ctx& ctx = *new Ctx; + ctx.logSqlEnter(sqlFunction); + HandleBase* pChild = 0; + HandleBase** ppChild = 0; + if (OutputHandle != 0) + ppChild = &pChild; + try { + pParent->sqlAllocHandle(ctx, HandleType, ppChild); + } catch (CtxAssert& ctxAssert) { + ctx.handleEx(ctxAssert); + } + if (OutputHandle != 0) + *OutputHandle = static_cast<SQLHANDLE>(pChild); + if (pRoot == pParent) + pRoot->lockHandle(); + pParent->saveCtx(ctx); + ctx.logSqlExit(); + SQLRETURN ret = ctx.getCode(); + if (pRoot == pParent) + pRoot->unlockHandle(); + driver_exit(SQL_API_SQLALLOCHANDLE); + return ret; +} +#endif // ODBCVER >= 0x0300 diff --git a/storage/ndb/src/old_files/client/odbc/driver/SQLAllocHandleStd.cpp b/storage/ndb/src/old_files/client/odbc/driver/SQLAllocHandleStd.cpp new file mode 100644 index 00000000000..61290e37b7b --- /dev/null +++ b/storage/ndb/src/old_files/client/odbc/driver/SQLAllocHandleStd.cpp @@ -0,0 +1,56 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "driver.hpp" + +#if ODBCVER >= 0x0300 +SQLRETURN SQL_API +SQLAllocHandleStd( + SQLSMALLINT fHandleType, + SQLHANDLE hInput, + SQLHANDLE* phOutput) +{ +#ifndef auto_SQLAllocHandleStd + const char* const sqlFunction = "SQLAllocHandleStd"; + Ctx ctx; + ctx_log1(("*** not implemented: %s", sqlFunction)); + return SQL_ERROR; +#else + driver_enter(SQL_API_SQLALLOCHANDLESTD); + const char* const sqlFunction = "SQLAllocHandleStd"; + HandleRoot* const pRoot = HandleRoot::instance(); + Handle* p = pRoot->find((SQLHANDLE*)0); + if (p == 0) { + driver_exit(SQL_API_SQLALLOCHANDLESTD); + return SQL_INVALID_HANDLE; + } + Ctx& ctx = *new Ctx; + ctx.logSqlEnter(sqlFunction); + if (ctx.ok()) + p->sqlAllocHandleStd( + ctx, + fHandleType, + hInput, + &phOutput + ); + p->saveCtx(ctx); + ctx.logSqlExit(); + SQLRETURN ret = ctx.getCode(); + driver_exit(SQL_API_SQLALLOCHANDLESTD); + return ret; +#endif +} +#endif // ODBCVER >= 0x0300 diff --git a/storage/ndb/src/old_files/client/odbc/driver/SQLAllocStmt.cpp b/storage/ndb/src/old_files/client/odbc/driver/SQLAllocStmt.cpp new file mode 100644 index 00000000000..bf3f149f5de --- /dev/null +++ b/storage/ndb/src/old_files/client/odbc/driver/SQLAllocStmt.cpp @@ -0,0 +1,52 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "driver.hpp" + +#if ODBCVER >= 0x0000 +SQLRETURN SQL_API +SQLAllocStmt( + SQLHDBC ConnectionHandle, + SQLHSTMT* StatementHandle) +{ + driver_enter(SQL_API_SQLALLOCSTMT); + const char* const sqlFunction = "SQLAllocStmt"; + HandleRoot* const pRoot = HandleRoot::instance(); + HandleDbc* pDbc = pRoot->findDbc(ConnectionHandle); + if (pDbc == 0) { + driver_exit(SQL_API_SQLALLOCSTMT); + return SQL_INVALID_HANDLE; + } + Ctx& ctx = *new Ctx; + ctx.logSqlEnter(sqlFunction); + HandleStmt* pStmt = 0; + HandleStmt** ppStmt = 0; + if (StatementHandle != 0) + ppStmt = &pStmt; + try { + pDbc->sqlAllocStmt(ctx, ppStmt); + } catch (CtxAssert& ctxAssert) { + ctx.handleEx(ctxAssert); + } + if (StatementHandle != 0) + *StatementHandle = static_cast<SQLHSTMT>(pStmt); + pDbc->saveCtx(ctx); + ctx.logSqlExit(); + SQLRETURN ret = ctx.getCode(); + driver_exit(SQL_API_SQLALLOCSTMT); + return ret; +} +#endif // ODBCVER >= 0x0000 diff --git a/storage/ndb/src/old_files/client/odbc/driver/SQLBindCol.cpp b/storage/ndb/src/old_files/client/odbc/driver/SQLBindCol.cpp new file mode 100644 index 00000000000..5562334e8cc --- /dev/null +++ b/storage/ndb/src/old_files/client/odbc/driver/SQLBindCol.cpp @@ -0,0 +1,50 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "driver.hpp" + +#if ODBCVER >= 0x0000 +SQLRETURN SQL_API +SQLBindCol( + SQLHSTMT StatementHandle, + SQLUSMALLINT ColumnNumber, + SQLSMALLINT TargetType, + SQLPOINTER TargetValue, + SQLINTEGER BufferLength, + SQLINTEGER* StrLen_or_Ind) +{ + driver_enter(SQL_API_SQLBINDCOL); + const char* const sqlFunction = "SQLBindCol"; + HandleRoot* const pRoot = HandleRoot::instance(); + HandleStmt* pStmt = pRoot->findStmt(StatementHandle); + if (pStmt == 0) { + driver_exit(SQL_API_SQLBINDCOL); + return SQL_INVALID_HANDLE; + } + Ctx& ctx = *new Ctx; + ctx.logSqlEnter(sqlFunction); + try { + pStmt->sqlBindCol(ctx, ColumnNumber, TargetType, TargetValue, BufferLength, StrLen_or_Ind); + } catch (CtxAssert& ctxAssert) { + ctx.handleEx(ctxAssert); + } + pStmt->saveCtx(ctx); + ctx.logSqlExit(); + SQLRETURN ret = ctx.getCode(); + driver_exit(SQL_API_SQLBINDCOL); + return ret; +} +#endif // ODBCVER >= 0x0000 diff --git a/storage/ndb/src/old_files/client/odbc/driver/SQLBindParam.cpp b/storage/ndb/src/old_files/client/odbc/driver/SQLBindParam.cpp new file mode 100644 index 00000000000..2fcc17b872f --- /dev/null +++ b/storage/ndb/src/old_files/client/odbc/driver/SQLBindParam.cpp @@ -0,0 +1,52 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "driver.hpp" + +#if ODBCVER >= 0x0300 +SQLRETURN SQL_API +SQLBindParam( + SQLHSTMT StatementHandle, + SQLUSMALLINT ParameterNumber, + SQLSMALLINT ValueType, + SQLSMALLINT ParameterType, + SQLUINTEGER LengthPrecision, + SQLSMALLINT ParameterScale, + SQLPOINTER ParameterValue, + SQLINTEGER* StrLen_or_Ind) +{ + driver_enter(SQL_API_SQLBINDPARAM); + const char* const sqlFunction = "SQLBindParam"; + HandleRoot* const pRoot = HandleRoot::instance(); + HandleStmt* pStmt = pRoot->findStmt(StatementHandle); + if (pStmt == 0) { + driver_exit(SQL_API_SQLBINDPARAM); + return SQL_INVALID_HANDLE; + } + Ctx& ctx = *new Ctx; + ctx.logSqlEnter(sqlFunction); + try { + pStmt->sqlBindParam(ctx, ParameterNumber, ValueType, ParameterType, LengthPrecision, ParameterScale, ParameterValue, StrLen_or_Ind); + } catch (CtxAssert& ctxAssert) { + ctx.handleEx(ctxAssert); + } + pStmt->saveCtx(ctx); + ctx.logSqlExit(); + SQLRETURN ret = ctx.getCode(); + driver_exit(SQL_API_SQLBINDPARAM); + return ret; +} +#endif // ODBCVER >= 0x0300 diff --git a/storage/ndb/src/old_files/client/odbc/driver/SQLBindParameter.cpp b/storage/ndb/src/old_files/client/odbc/driver/SQLBindParameter.cpp new file mode 100644 index 00000000000..e4ca5bbc731 --- /dev/null +++ b/storage/ndb/src/old_files/client/odbc/driver/SQLBindParameter.cpp @@ -0,0 +1,54 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "driver.hpp" + +#if ODBCVER >= 0x0000 +SQLRETURN SQL_API +SQLBindParameter( + SQLHSTMT hstmt, + SQLUSMALLINT ipar, + SQLSMALLINT fParamType, + SQLSMALLINT fCType, + SQLSMALLINT fSqlType, + SQLUINTEGER cbColDef, + SQLSMALLINT ibScale, + SQLPOINTER rgbValue, + SQLINTEGER cbValueMax, + SQLINTEGER* pcbValue) +{ + driver_enter(SQL_API_SQLBINDPARAMETER); + const char* const sqlFunction = "SQLBindParameter"; + HandleRoot* const pRoot = HandleRoot::instance(); + HandleStmt* pStmt = pRoot->findStmt(hstmt); + if (pStmt == 0) { + driver_exit(SQL_API_SQLBINDPARAMETER); + return SQL_INVALID_HANDLE; + } + Ctx& ctx = *new Ctx; + ctx.logSqlEnter(sqlFunction); + try { + pStmt->sqlBindParameter(ctx, ipar, fParamType, fCType, fSqlType, cbColDef, ibScale, rgbValue, cbValueMax, pcbValue); + } catch (CtxAssert& ctxAssert) { + ctx.handleEx(ctxAssert); + } + pStmt->saveCtx(ctx); + ctx.logSqlExit(); + SQLRETURN ret = ctx.getCode(); + driver_exit(SQL_API_SQLBINDPARAMETER); + return ret; +} +#endif // ODBCVER >= 0x0000 diff --git a/storage/ndb/src/old_files/client/odbc/driver/SQLBrowseConnect.cpp b/storage/ndb/src/old_files/client/odbc/driver/SQLBrowseConnect.cpp new file mode 100644 index 00000000000..7e629e199e5 --- /dev/null +++ b/storage/ndb/src/old_files/client/odbc/driver/SQLBrowseConnect.cpp @@ -0,0 +1,61 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "driver.hpp" + +#if ODBCVER >= 0x0000 +SQLRETURN SQL_API +SQLBrowseConnect( + SQLHDBC hdbc, + SQLCHAR* szConnStrIn, + SQLSMALLINT cbConnStrIn, + SQLCHAR* szConnStrOut, + SQLSMALLINT cbConnStrOutMax, + SQLSMALLINT* pcbConnStrOut) +{ +#ifndef auto_SQLBrowseConnect + const char* const sqlFunction = "SQLBrowseConnect"; + Ctx ctx; + ctx_log1(("*** not implemented: %s", sqlFunction)); + return SQL_ERROR; +#else + driver_enter(SQL_API_SQLBROWSECONNECT); + const char* const sqlFunction = "SQLBrowseConnect"; + HandleRoot* const pRoot = HandleRoot::instance(); + HandleDbc* pDbc = pRoot->findDbc(hdbc); + if (pDbc == 0) { + driver_exit(SQL_API_SQLBROWSECONNECT); + return SQL_INVALID_HANDLE; + } + Ctx& ctx = *new Ctx; + ctx.logSqlEnter(sqlFunction); + if (ctx.ok()) + pDbc->sqlBrowseConnect( + ctx, + &szConnStrIn, + cbConnStrIn, + &szConnStrOut, + cbConnStrOutMax, + &pcbConnStrOut + ); + pDbc->saveCtx(ctx); + ctx.logSqlExit(); + SQLRETURN ret = ctx.getCode(); + driver_exit(SQL_API_SQLBROWSECONNECT); + return ret; +#endif +} +#endif // ODBCVER >= 0x0000 diff --git a/storage/ndb/src/old_files/client/odbc/driver/SQLBulkOperations.cpp b/storage/ndb/src/old_files/client/odbc/driver/SQLBulkOperations.cpp new file mode 100644 index 00000000000..7d256d66e3f --- /dev/null +++ b/storage/ndb/src/old_files/client/odbc/driver/SQLBulkOperations.cpp @@ -0,0 +1,53 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "driver.hpp" + +#if ODBCVER >= 0x0300 +SQLRETURN SQL_API +SQLBulkOperations( + SQLHSTMT StatementHandle, + SQLSMALLINT Operation) +{ +#ifndef auto_SQLBulkOperations + const char* const sqlFunction = "SQLBulkOperations"; + Ctx ctx; + ctx_log1(("*** not implemented: %s", sqlFunction)); + return SQL_ERROR; +#else + driver_enter(SQL_API_SQLBULKOPERATIONS); + const char* const sqlFunction = "SQLBulkOperations"; + HandleRoot* const pRoot = HandleRoot::instance(); + HandleStmt* pStmt = pRoot->findStmt(StatementHandle); + if (pStmt == 0) { + driver_exit(SQL_API_SQLBULKOPERATIONS); + return SQL_INVALID_HANDLE; + } + Ctx& ctx = *new Ctx; + ctx.logSqlEnter(sqlFunction); + if (ctx.ok()) + pStmt->sqlBulkOperations( + ctx, + Operation + ); + pStmt->saveCtx(ctx); + ctx.logSqlExit(); + SQLRETURN ret = ctx.getCode(); + driver_exit(SQL_API_SQLBULKOPERATIONS); + return ret; +#endif +} +#endif // ODBCVER >= 0x0300 diff --git a/storage/ndb/src/old_files/client/odbc/driver/SQLCancel.cpp b/storage/ndb/src/old_files/client/odbc/driver/SQLCancel.cpp new file mode 100644 index 00000000000..ac4e43c6e89 --- /dev/null +++ b/storage/ndb/src/old_files/client/odbc/driver/SQLCancel.cpp @@ -0,0 +1,45 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "driver.hpp" + +#if ODBCVER >= 0x0000 +SQLRETURN SQL_API +SQLCancel( + SQLHSTMT StatementHandle) +{ + driver_enter(SQL_API_SQLCANCEL); + const char* const sqlFunction = "SQLCancel"; + HandleRoot* const pRoot = HandleRoot::instance(); + HandleStmt* pStmt = pRoot->findStmt(StatementHandle); + if (pStmt == 0) { + driver_exit(SQL_API_SQLCANCEL); + return SQL_INVALID_HANDLE; + } + Ctx& ctx = *new Ctx; + ctx.logSqlEnter(sqlFunction); + try { + pStmt->sqlCancel(ctx); + } catch (CtxAssert& ctxAssert) { + ctx.handleEx(ctxAssert); + } + pStmt->saveCtx(ctx); + ctx.logSqlExit(); + SQLRETURN ret = ctx.getCode(); + driver_exit(SQL_API_SQLCANCEL); + return ret; +} +#endif // ODBCVER >= 0x0000 diff --git a/storage/ndb/src/old_files/client/odbc/driver/SQLCloseCursor.cpp b/storage/ndb/src/old_files/client/odbc/driver/SQLCloseCursor.cpp new file mode 100644 index 00000000000..26d88c91e3b --- /dev/null +++ b/storage/ndb/src/old_files/client/odbc/driver/SQLCloseCursor.cpp @@ -0,0 +1,45 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "driver.hpp" + +#if ODBCVER >= 0x0300 +SQLRETURN SQL_API +SQLCloseCursor( + SQLHSTMT StatementHandle) +{ + driver_enter(SQL_API_SQLCLOSECURSOR); + const char* const sqlFunction = "SQLCloseCursor"; + HandleRoot* const pRoot = HandleRoot::instance(); + HandleStmt* pStmt = pRoot->findStmt(StatementHandle); + if (pStmt == 0) { + driver_exit(SQL_API_SQLCLOSECURSOR); + return SQL_INVALID_HANDLE; + } + Ctx& ctx = *new Ctx; + ctx.logSqlEnter(sqlFunction); + try { + pStmt->sqlCloseCursor(ctx); + } catch (CtxAssert& ctxAssert) { + ctx.handleEx(ctxAssert); + } + pStmt->saveCtx(ctx); + ctx.logSqlExit(); + SQLRETURN ret = ctx.getCode(); + driver_exit(SQL_API_SQLCLOSECURSOR); + return ret; +} +#endif // ODBCVER >= 0x0300 diff --git a/storage/ndb/src/old_files/client/odbc/driver/SQLColAttribute.cpp b/storage/ndb/src/old_files/client/odbc/driver/SQLColAttribute.cpp new file mode 100644 index 00000000000..0e7e5446932 --- /dev/null +++ b/storage/ndb/src/old_files/client/odbc/driver/SQLColAttribute.cpp @@ -0,0 +1,51 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "driver.hpp" + +#if ODBCVER >= 0x0300 +SQLRETURN SQL_API +SQLColAttribute( + SQLHSTMT StatementHandle, + SQLUSMALLINT ColumnNumber, + SQLUSMALLINT FieldIdentifier, + SQLPOINTER CharacterAttribute, + SQLSMALLINT BufferLength, + SQLSMALLINT* StringLength, + SQLPOINTER NumericAttribute) +{ + driver_enter(SQL_API_SQLCOLATTRIBUTE); + const char* const sqlFunction = "SQLColAttribute"; + HandleRoot* const pRoot = HandleRoot::instance(); + HandleStmt* pStmt = pRoot->findStmt(StatementHandle); + if (pStmt == 0) { + driver_exit(SQL_API_SQLCOLATTRIBUTE); + return SQL_INVALID_HANDLE; + } + Ctx& ctx = *new Ctx; + ctx.logSqlEnter(sqlFunction); + try { + pStmt->sqlColAttribute(ctx, ColumnNumber, FieldIdentifier, CharacterAttribute, BufferLength, StringLength, NumericAttribute); + } catch (CtxAssert& ctxAssert) { + ctx.handleEx(ctxAssert); + } + pStmt->saveCtx(ctx); + ctx.logSqlExit(); + SQLRETURN ret = ctx.getCode(); + driver_exit(SQL_API_SQLCOLATTRIBUTE); + return ret; +} +#endif // ODBCVER >= 0x0300 diff --git a/storage/ndb/src/old_files/client/odbc/driver/SQLColAttributes.cpp b/storage/ndb/src/old_files/client/odbc/driver/SQLColAttributes.cpp new file mode 100644 index 00000000000..05a4c1d4d37 --- /dev/null +++ b/storage/ndb/src/old_files/client/odbc/driver/SQLColAttributes.cpp @@ -0,0 +1,51 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "driver.hpp" + +#if ODBCVER >= 0x0000 +SQLRETURN SQL_API +SQLColAttributes( + SQLHSTMT hstmt, + SQLUSMALLINT icol, + SQLUSMALLINT fDescType, + SQLPOINTER rgbDesc, + SQLSMALLINT cbDescMax, + SQLSMALLINT* pcbDesc, + SQLINTEGER* pfDesc) +{ + driver_enter(SQL_API_SQLCOLATTRIBUTES); + const char* const sqlFunction = "SQLColAttributes"; + HandleRoot* const pRoot = HandleRoot::instance(); + HandleStmt* pStmt = pRoot->findStmt(hstmt); + if (pStmt == 0) { + driver_exit(SQL_API_SQLCOLATTRIBUTES); + return SQL_INVALID_HANDLE; + } + Ctx& ctx = *new Ctx; + ctx.logSqlEnter(sqlFunction); + try { + pStmt->sqlColAttributes(ctx, icol, fDescType, rgbDesc, cbDescMax, pcbDesc, pfDesc); + } catch (CtxAssert& ctxAssert) { + ctx.handleEx(ctxAssert); + } + pStmt->saveCtx(ctx); + ctx.logSqlExit(); + SQLRETURN ret = ctx.getCode(); + driver_exit(SQL_API_SQLCOLATTRIBUTES); + return ret; +} +#endif // ODBCVER >= 0x0000 diff --git a/storage/ndb/src/old_files/client/odbc/driver/SQLColumnPrivileges.cpp b/storage/ndb/src/old_files/client/odbc/driver/SQLColumnPrivileges.cpp new file mode 100644 index 00000000000..cfbc9c2bc57 --- /dev/null +++ b/storage/ndb/src/old_files/client/odbc/driver/SQLColumnPrivileges.cpp @@ -0,0 +1,67 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "driver.hpp" + +#if ODBCVER >= 0x0000 +SQLRETURN SQL_API +SQLColumnPrivileges( + SQLHSTMT hstmt, + SQLCHAR* szCatalogName, + SQLSMALLINT cbCatalogName, + SQLCHAR* szSchemaName, + SQLSMALLINT cbSchemaName, + SQLCHAR* szTableName, + SQLSMALLINT cbTableName, + SQLCHAR* szColumnName, + SQLSMALLINT cbColumnName) +{ +#ifndef auto_SQLColumnPrivileges + const char* const sqlFunction = "SQLColumnPrivileges"; + Ctx ctx; + ctx_log1(("*** not implemented: %s", sqlFunction)); + return SQL_ERROR; +#else + driver_enter(SQL_API_SQLCOLUMNPRIVILEGES); + const char* const sqlFunction = "SQLColumnPrivileges"; + HandleRoot* const pRoot = HandleRoot::instance(); + HandleStmt* pStmt = pRoot->findStmt(hstmt); + if (pStmt == 0) { + driver_exit(SQL_API_SQLCOLUMNPRIVILEGES); + return SQL_INVALID_HANDLE; + } + Ctx& ctx = *new Ctx; + ctx.logSqlEnter(sqlFunction); + if (ctx.ok()) + pStmt->sqlColumnPrivileges( + ctx, + &szCatalogName, + cbCatalogName, + &szSchemaName, + cbSchemaName, + &szTableName, + cbTableName, + &szColumnName, + cbColumnName + ); + pStmt->saveCtx(ctx); + ctx.logSqlExit(); + SQLRETURN ret = ctx.getCode(); + driver_exit(SQL_API_SQLCOLUMNPRIVILEGES); + return ret; +#endif +} +#endif // ODBCVER >= 0x0000 diff --git a/storage/ndb/src/old_files/client/odbc/driver/SQLColumns.cpp b/storage/ndb/src/old_files/client/odbc/driver/SQLColumns.cpp new file mode 100644 index 00000000000..4e0b646ee7d --- /dev/null +++ b/storage/ndb/src/old_files/client/odbc/driver/SQLColumns.cpp @@ -0,0 +1,49 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "driver.hpp" + +#if ODBCVER >= 0x0000 +SQLRETURN SQL_API +SQLColumns( + SQLHSTMT StatementHandle, + SQLCHAR* CatalogName, + SQLSMALLINT NameLength1, + SQLCHAR* SchemaName, + SQLSMALLINT NameLength2, + SQLCHAR* TableName, + SQLSMALLINT NameLength3, + SQLCHAR* ColumnName, + SQLSMALLINT NameLength4) +{ + driver_enter(SQL_API_SQLCOLUMNS); + const char* const sqlFunction = "SQLColumns"; + HandleRoot* const pRoot = HandleRoot::instance(); + HandleStmt* pStmt = pRoot->findStmt(StatementHandle); + if (pStmt == 0) { + driver_exit(SQL_API_SQLCOLUMNS); + return SQL_INVALID_HANDLE; + } + Ctx& ctx = *new Ctx; + ctx.logSqlEnter(sqlFunction); + pStmt->sqlColumns(ctx, CatalogName, NameLength1, SchemaName, NameLength2, TableName, NameLength3, ColumnName, NameLength4); + pStmt->saveCtx(ctx); + ctx.logSqlExit(); + SQLRETURN ret = ctx.getCode(); + driver_exit(SQL_API_SQLCOLUMNS); + return ret; +} +#endif // ODBCVER >= 0x0000 diff --git a/storage/ndb/src/old_files/client/odbc/driver/SQLConnect.cpp b/storage/ndb/src/old_files/client/odbc/driver/SQLConnect.cpp new file mode 100644 index 00000000000..d8f30ed47e7 --- /dev/null +++ b/storage/ndb/src/old_files/client/odbc/driver/SQLConnect.cpp @@ -0,0 +1,51 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "driver.hpp" + +#if ODBCVER >= 0x0000 +SQLRETURN SQL_API +SQLConnect( + SQLHDBC ConnectionHandle, + SQLCHAR* ServerName, + SQLSMALLINT NameLength1, + SQLCHAR* UserName, + SQLSMALLINT NameLength2, + SQLCHAR* Authentication, + SQLSMALLINT NameLength3) +{ + driver_enter(SQL_API_SQLCONNECT); + const char* const sqlFunction = "SQLConnect"; + HandleRoot* const pRoot = HandleRoot::instance(); + HandleDbc* pDbc = pRoot->findDbc(ConnectionHandle); + if (pDbc == 0) { + driver_exit(SQL_API_SQLCONNECT); + return SQL_INVALID_HANDLE; + } + Ctx& ctx = *new Ctx; + ctx.logSqlEnter(sqlFunction); + try { + pDbc->sqlConnect(ctx, ServerName, NameLength1, UserName, NameLength2, Authentication, NameLength3); + } catch (CtxAssert& ctxAssert) { + ctx.handleEx(ctxAssert); + } + pDbc->saveCtx(ctx); + ctx.logSqlExit(); + SQLRETURN ret = ctx.getCode(); + driver_exit(SQL_API_SQLCONNECT); + return ret; +} +#endif // ODBCVER >= 0x0000 diff --git a/storage/ndb/src/old_files/client/odbc/driver/SQLCopyDesc.cpp b/storage/ndb/src/old_files/client/odbc/driver/SQLCopyDesc.cpp new file mode 100644 index 00000000000..b4d4b2e4122 --- /dev/null +++ b/storage/ndb/src/old_files/client/odbc/driver/SQLCopyDesc.cpp @@ -0,0 +1,58 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "driver.hpp" + +#if ODBCVER >= 0x0300 +SQLRETURN SQL_API +SQLCopyDesc( + SQLHDESC SourceDescHandle, + SQLHDESC TargetDescHandle) +{ +#ifndef auto_SQLCopyDesc + const char* const sqlFunction = "SQLCopyDesc"; + Ctx ctx; + ctx_log1(("*** not implemented: %s", sqlFunction)); + return SQL_ERROR; +#else + driver_enter(SQL_API_SQLCOPYDESC); + const char* const sqlFunction = "SQLCopyDesc"; + HandleRoot* const pRoot = HandleRoot::instance(); + HandleDesc* pDesc = pRoot->findDesc(SourceDescHandle); + if (pDesc == 0) { + driver_exit(SQL_API_SQLCOPYDESC); + return SQL_INVALID_HANDLE; + } + HandleDesc* pDesc = pRoot->findDesc(TargetDescHandle); + if (pDesc == 0) { + driver_exit(SQL_API_SQLCOPYDESC); + return SQL_INVALID_HANDLE; + } + Ctx& ctx = *new Ctx; + ctx.logSqlEnter(sqlFunction); + if (ctx.ok()) + pDesc->sqlCopyDesc( + ctx, + pDesc + ); + pDesc->saveCtx(ctx); + ctx.logSqlExit(); + SQLRETURN ret = ctx.getCode(); + driver_exit(SQL_API_SQLCOPYDESC); + return ret; +#endif +} +#endif // ODBCVER >= 0x0300 diff --git a/storage/ndb/src/old_files/client/odbc/driver/SQLDataSources.cpp b/storage/ndb/src/old_files/client/odbc/driver/SQLDataSources.cpp new file mode 100644 index 00000000000..6115e7175f9 --- /dev/null +++ b/storage/ndb/src/old_files/client/odbc/driver/SQLDataSources.cpp @@ -0,0 +1,65 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "driver.hpp" + +#if ODBCVER >= 0x0000 +SQLRETURN SQL_API +SQLDataSources( + SQLHENV EnvironmentHandle, + SQLUSMALLINT Direction, + SQLCHAR* ServerName, + SQLSMALLINT BufferLength1, + SQLSMALLINT* NameLength1, + SQLCHAR* Description, + SQLSMALLINT BufferLength2, + SQLSMALLINT* NameLength2) +{ +#ifndef auto_SQLDataSources + const char* const sqlFunction = "SQLDataSources"; + Ctx ctx; + ctx_log1(("*** not implemented: %s", sqlFunction)); + return SQL_ERROR; +#else + driver_enter(SQL_API_SQLDATASOURCES); + const char* const sqlFunction = "SQLDataSources"; + HandleRoot* const pRoot = HandleRoot::instance(); + HandleEnv* pEnv = pRoot->findEnv(EnvironmentHandle); + if (pEnv == 0) { + driver_exit(SQL_API_SQLDATASOURCES); + return SQL_INVALID_HANDLE; + } + Ctx& ctx = *new Ctx; + ctx.logSqlEnter(sqlFunction); + if (ctx.ok()) + pEnv->sqlDataSources( + ctx, + Direction, + &ServerName, + BufferLength1, + &NameLength1, + &Description, + BufferLength2, + &NameLength2 + ); + pEnv->saveCtx(ctx); + ctx.logSqlExit(); + SQLRETURN ret = ctx.getCode(); + driver_exit(SQL_API_SQLDATASOURCES); + return ret; +#endif +} +#endif // ODBCVER >= 0x0000 diff --git a/storage/ndb/src/old_files/client/odbc/driver/SQLDescribeCol.cpp b/storage/ndb/src/old_files/client/odbc/driver/SQLDescribeCol.cpp new file mode 100644 index 00000000000..f15ce8962f1 --- /dev/null +++ b/storage/ndb/src/old_files/client/odbc/driver/SQLDescribeCol.cpp @@ -0,0 +1,53 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "driver.hpp" + +#if ODBCVER >= 0x0000 +SQLRETURN SQL_API +SQLDescribeCol( + SQLHSTMT StatementHandle, + SQLUSMALLINT ColumnNumber, + SQLCHAR* ColumnName, + SQLSMALLINT BufferLength, + SQLSMALLINT* NameLength, + SQLSMALLINT* DataType, + SQLUINTEGER* ColumnSize, + SQLSMALLINT* DecimalDigits, + SQLSMALLINT* Nullable) +{ + driver_enter(SQL_API_SQLDESCRIBECOL); + const char* const sqlFunction = "SQLDescribeCol"; + HandleRoot* const pRoot = HandleRoot::instance(); + HandleStmt* pStmt = pRoot->findStmt(StatementHandle); + if (pStmt == 0) { + driver_exit(SQL_API_SQLDESCRIBECOL); + return SQL_INVALID_HANDLE; + } + Ctx& ctx = *new Ctx; + ctx.logSqlEnter(sqlFunction); + try { + pStmt->sqlDescribeCol(ctx, ColumnNumber, ColumnName, BufferLength, NameLength, DataType, ColumnSize, DecimalDigits, Nullable); + } catch (CtxAssert& ctxAssert) { + ctx.handleEx(ctxAssert); + } + pStmt->saveCtx(ctx); + ctx.logSqlExit(); + SQLRETURN ret = ctx.getCode(); + driver_exit(SQL_API_SQLDESCRIBECOL); + return ret; +} +#endif // ODBCVER >= 0x0000 diff --git a/storage/ndb/src/old_files/client/odbc/driver/SQLDescribeParam.cpp b/storage/ndb/src/old_files/client/odbc/driver/SQLDescribeParam.cpp new file mode 100644 index 00000000000..beff41396fe --- /dev/null +++ b/storage/ndb/src/old_files/client/odbc/driver/SQLDescribeParam.cpp @@ -0,0 +1,50 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "driver.hpp" + +#if ODBCVER >= 0x0000 +SQLRETURN SQL_API +SQLDescribeParam( + SQLHSTMT hstmt, + SQLUSMALLINT ipar, + SQLSMALLINT* pfSqlType, + SQLUINTEGER* pcbParamDef, + SQLSMALLINT* pibScale, + SQLSMALLINT* pfNullable) +{ + driver_enter(SQL_API_SQLDESCRIBEPARAM); + const char* const sqlFunction = "SQLDescribeParam"; + HandleRoot* const pRoot = HandleRoot::instance(); + HandleStmt* pStmt = pRoot->findStmt(hstmt); + if (pStmt == 0) { + driver_exit(SQL_API_SQLDESCRIBEPARAM); + return SQL_INVALID_HANDLE; + } + Ctx& ctx = *new Ctx; + ctx.logSqlEnter(sqlFunction); + try { + pStmt->sqlDescribeParam(ctx, ipar, pfSqlType, pcbParamDef, pibScale, pfNullable); + } catch (CtxAssert& ctxAssert) { + ctx.handleEx(ctxAssert); + } + pStmt->saveCtx(ctx); + ctx.logSqlExit(); + SQLRETURN ret = ctx.getCode(); + driver_exit(SQL_API_SQLDESCRIBEPARAM); + return ret; +} +#endif // ODBCVER >= 0x0000 diff --git a/storage/ndb/src/old_files/client/odbc/driver/SQLDisconnect.cpp b/storage/ndb/src/old_files/client/odbc/driver/SQLDisconnect.cpp new file mode 100644 index 00000000000..75db5604da8 --- /dev/null +++ b/storage/ndb/src/old_files/client/odbc/driver/SQLDisconnect.cpp @@ -0,0 +1,45 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "driver.hpp" + +#if ODBCVER >= 0x0000 +SQLRETURN SQL_API +SQLDisconnect( + SQLHDBC ConnectionHandle) +{ + driver_enter(SQL_API_SQLDISCONNECT); + const char* const sqlFunction = "SQLDisconnect"; + HandleRoot* const pRoot = HandleRoot::instance(); + HandleDbc* pDbc = pRoot->findDbc(ConnectionHandle); + if (pDbc == 0) { + driver_exit(SQL_API_SQLDISCONNECT); + return SQL_INVALID_HANDLE; + } + Ctx& ctx = *new Ctx; + ctx.logSqlEnter(sqlFunction); + try { + pDbc->sqlDisconnect(ctx); + } catch (CtxAssert& ctxAssert) { + ctx.handleEx(ctxAssert); + } + pDbc->saveCtx(ctx); + ctx.logSqlExit(); + SQLRETURN ret = ctx.getCode(); + driver_exit(SQL_API_SQLDISCONNECT); + return ret; +} +#endif // ODBCVER >= 0x0000 diff --git a/storage/ndb/src/old_files/client/odbc/driver/SQLDriverConnect.cpp b/storage/ndb/src/old_files/client/odbc/driver/SQLDriverConnect.cpp new file mode 100644 index 00000000000..340babd8523 --- /dev/null +++ b/storage/ndb/src/old_files/client/odbc/driver/SQLDriverConnect.cpp @@ -0,0 +1,52 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "driver.hpp" + +#if ODBCVER >= 0x0000 +SQLRETURN SQL_API +SQLDriverConnect( + SQLHDBC hdbc, + SQLHWND hwnd, + SQLCHAR* szConnStrIn, + SQLSMALLINT cbConnStrIn, + SQLCHAR* szConnStrOut, + SQLSMALLINT cbConnStrOutMax, + SQLSMALLINT* pcbConnStrOut, + SQLUSMALLINT fDriverCompletion) +{ + driver_enter(SQL_API_SQLDRIVERCONNECT); + const char* const sqlFunction = "SQLDriverConnect"; + HandleRoot* const pRoot = HandleRoot::instance(); + HandleDbc* pDbc = pRoot->findDbc(hdbc); + if (pDbc == 0) { + driver_exit(SQL_API_SQLDRIVERCONNECT); + return SQL_INVALID_HANDLE; + } + Ctx& ctx = *new Ctx; + ctx.logSqlEnter(sqlFunction); + try { + pDbc->sqlDriverConnect(ctx, hwnd, szConnStrIn, cbConnStrIn, szConnStrOut, cbConnStrOutMax, pcbConnStrOut, fDriverCompletion); + } catch (CtxAssert& ctxAssert) { + ctx.handleEx(ctxAssert); + } + pDbc->saveCtx(ctx); + ctx.logSqlExit(); + SQLRETURN ret = ctx.getCode(); + driver_exit(SQL_API_SQLDRIVERCONNECT); + return ret; +} +#endif // ODBCVER >= 0x0000 diff --git a/storage/ndb/src/old_files/client/odbc/driver/SQLDrivers.cpp b/storage/ndb/src/old_files/client/odbc/driver/SQLDrivers.cpp new file mode 100644 index 00000000000..9c52f900992 --- /dev/null +++ b/storage/ndb/src/old_files/client/odbc/driver/SQLDrivers.cpp @@ -0,0 +1,65 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "driver.hpp" + +#if ODBCVER >= 0x0000 +SQLRETURN SQL_API +SQLDrivers( + SQLHENV henv, + SQLUSMALLINT fDirection, + SQLCHAR* szDriverDesc, + SQLSMALLINT cbDriverDescMax, + SQLSMALLINT* pcbDriverDesc, + SQLCHAR* szDriverAttributes, + SQLSMALLINT cbDrvrAttrMax, + SQLSMALLINT* pcbDrvrAttr) +{ +#ifndef auto_SQLDrivers + const char* const sqlFunction = "SQLDrivers"; + Ctx ctx; + ctx_log1(("*** not implemented: %s", sqlFunction)); + return SQL_ERROR; +#else + driver_enter(SQL_API_SQLDRIVERS); + const char* const sqlFunction = "SQLDrivers"; + HandleRoot* const pRoot = HandleRoot::instance(); + HandleEnv* pEnv = pRoot->findEnv(henv); + if (pEnv == 0) { + driver_exit(SQL_API_SQLDRIVERS); + return SQL_INVALID_HANDLE; + } + Ctx& ctx = *new Ctx; + ctx.logSqlEnter(sqlFunction); + if (ctx.ok()) + pEnv->sqlDrivers( + ctx, + fDirection, + &szDriverDesc, + cbDriverDescMax, + &pcbDriverDesc, + &szDriverAttributes, + cbDrvrAttrMax, + &pcbDrvrAttr + ); + pEnv->saveCtx(ctx); + ctx.logSqlExit(); + SQLRETURN ret = ctx.getCode(); + driver_exit(SQL_API_SQLDRIVERS); + return ret; +#endif +} +#endif // ODBCVER >= 0x0000 diff --git a/storage/ndb/src/old_files/client/odbc/driver/SQLEndTran.cpp b/storage/ndb/src/old_files/client/odbc/driver/SQLEndTran.cpp new file mode 100644 index 00000000000..20b0b2203f5 --- /dev/null +++ b/storage/ndb/src/old_files/client/odbc/driver/SQLEndTran.cpp @@ -0,0 +1,70 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "driver.hpp" + +#if ODBCVER >= 0x0300 +SQLRETURN SQL_API +SQLEndTran( + SQLSMALLINT HandleType, + SQLHANDLE Handle, + SQLSMALLINT CompletionType) +{ + driver_enter(SQL_API_SQLENDTRAN); + const char* const sqlFunction = "SQLEndTran"; + HandleRoot* const pRoot = HandleRoot::instance(); + if (HandleType == SQL_HANDLE_DBC) { + HandleDbc* pDbc = pRoot->findDbc(Handle); + if (pDbc == 0) { + driver_exit(SQL_API_SQLENDTRAN); + return SQL_INVALID_HANDLE; + } + Ctx& ctx = *new Ctx; + ctx.logSqlEnter(sqlFunction); + try { + pDbc->sqlEndTran(ctx, CompletionType); + } catch (CtxAssert& ctxAssert) { + ctx.handleEx(ctxAssert); + } + pDbc->saveCtx(ctx); + ctx.logSqlExit(); + SQLRETURN ret = ctx.getCode(); + driver_exit(SQL_API_SQLENDTRAN); + return ret; + } + if (HandleType == SQL_HANDLE_ENV) { + HandleEnv* pEnv = pRoot->findEnv(Handle); + if (pEnv == 0) { + driver_exit(SQL_API_SQLENDTRAN); + return SQL_INVALID_HANDLE; + } + Ctx& ctx = *new Ctx; + ctx.logSqlEnter(sqlFunction); + try { + pEnv->sqlEndTran(ctx, CompletionType); + } catch (CtxAssert& ctxAssert) { + ctx.handleEx(ctxAssert); + } + pEnv->saveCtx(ctx); + ctx.logSqlExit(); + SQLRETURN ret = ctx.getCode(); + driver_exit(SQL_API_SQLENDTRAN); + return ret; + } + driver_exit(SQL_API_SQLENDTRAN); + return SQL_INVALID_HANDLE; +} +#endif // ODBCVER >= 0x0300 diff --git a/storage/ndb/src/old_files/client/odbc/driver/SQLError.cpp b/storage/ndb/src/old_files/client/odbc/driver/SQLError.cpp new file mode 100644 index 00000000000..af78c931d37 --- /dev/null +++ b/storage/ndb/src/old_files/client/odbc/driver/SQLError.cpp @@ -0,0 +1,67 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "driver.hpp" + +#if ODBCVER >= 0x0000 +SQLRETURN SQL_API +SQLError( + SQLHENV EnvironmentHandle, + SQLHDBC ConnectionHandle, + SQLHSTMT StatementHandle, + SQLCHAR* Sqlstate, + SQLINTEGER* NativeError, + SQLCHAR* MessageText, + SQLSMALLINT BufferLength, + SQLSMALLINT* TextLength) +{ + driver_enter(SQL_API_SQLERROR); + const char* const sqlFunction = "SQLError"; + HandleRoot* const pRoot = HandleRoot::instance(); + HandleEnv* pEnv = pRoot->findEnv(EnvironmentHandle); + HandleDbc* pDbc = pRoot->findDbc(ConnectionHandle); + HandleStmt* pStmt = pRoot->findStmt(StatementHandle); + if (pStmt == 0 && pDbc == 0 && pEnv == 0) { + driver_exit(SQL_API_SQLERROR); + return SQL_INVALID_HANDLE; + } + Ctx ctx; // discard diagnostics + ctx.logSqlEnter(sqlFunction); + if (pStmt != 0) { + try { + pStmt->sqlError(ctx, Sqlstate, NativeError, MessageText, BufferLength, TextLength); + } catch (CtxAssert& ctxAssert) { + ctx.handleEx(ctxAssert); + } + } else if (pDbc != 0) { + try { + pDbc->sqlError(ctx, Sqlstate, NativeError, MessageText, BufferLength, TextLength); + } catch (CtxAssert& ctxAssert) { + ctx.handleEx(ctxAssert); + } + } else { + try { + pEnv->sqlError(ctx, Sqlstate, NativeError, MessageText, BufferLength, TextLength); + } catch (CtxAssert& ctxAssert) { + ctx.handleEx(ctxAssert); + } + } + ctx.logSqlExit(); + SQLRETURN ret = ctx.getCode(); + driver_exit(SQL_API_SQLERROR); + return ret; +} +#endif // ODBCVER >= 0x0000 diff --git a/storage/ndb/src/old_files/client/odbc/driver/SQLExecDirect.cpp b/storage/ndb/src/old_files/client/odbc/driver/SQLExecDirect.cpp new file mode 100644 index 00000000000..0ad99d29cd9 --- /dev/null +++ b/storage/ndb/src/old_files/client/odbc/driver/SQLExecDirect.cpp @@ -0,0 +1,47 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "driver.hpp" + +#if ODBCVER >= 0x0000 +SQLRETURN SQL_API +SQLExecDirect( + SQLHSTMT StatementHandle, + SQLCHAR* StatementText, + SQLINTEGER TextLength) +{ + driver_enter(SQL_API_SQLEXECDIRECT); + const char* const sqlFunction = "SQLExecDirect"; + HandleRoot* const pRoot = HandleRoot::instance(); + HandleStmt* pStmt = pRoot->findStmt(StatementHandle); + if (pStmt == 0) { + driver_exit(SQL_API_SQLEXECDIRECT); + return SQL_INVALID_HANDLE; + } + Ctx& ctx = *new Ctx; + ctx.logSqlEnter(sqlFunction); + try { + pStmt->sqlExecDirect(ctx, StatementText, TextLength); + } catch (CtxAssert& ctxAssert) { + ctx.handleEx(ctxAssert); + } + pStmt->saveCtx(ctx); + ctx.logSqlExit(); + SQLRETURN ret = ctx.getCode(); + driver_exit(SQL_API_SQLEXECDIRECT); + return ret; +} +#endif // ODBCVER >= 0x0000 diff --git a/storage/ndb/src/old_files/client/odbc/driver/SQLExecute.cpp b/storage/ndb/src/old_files/client/odbc/driver/SQLExecute.cpp new file mode 100644 index 00000000000..9c30d418f09 --- /dev/null +++ b/storage/ndb/src/old_files/client/odbc/driver/SQLExecute.cpp @@ -0,0 +1,45 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "driver.hpp" + +#if ODBCVER >= 0x0000 +SQLRETURN SQL_API +SQLExecute( + SQLHSTMT StatementHandle) +{ + driver_enter(SQL_API_SQLEXECUTE); + const char* const sqlFunction = "SQLExecute"; + HandleRoot* const pRoot = HandleRoot::instance(); + HandleStmt* pStmt = pRoot->findStmt(StatementHandle); + if (pStmt == 0) { + driver_exit(SQL_API_SQLEXECUTE); + return SQL_INVALID_HANDLE; + } + Ctx& ctx = *new Ctx; + ctx.logSqlEnter(sqlFunction); + try { + pStmt->sqlExecute(ctx); + } catch (CtxAssert& ctxAssert) { + ctx.handleEx(ctxAssert); + } + pStmt->saveCtx(ctx); + ctx.logSqlExit(); + SQLRETURN ret = ctx.getCode(); + driver_exit(SQL_API_SQLEXECUTE); + return ret; +} +#endif // ODBCVER >= 0x0000 diff --git a/storage/ndb/src/old_files/client/odbc/driver/SQLExtendedFetch.cpp b/storage/ndb/src/old_files/client/odbc/driver/SQLExtendedFetch.cpp new file mode 100644 index 00000000000..e0dd078b5d0 --- /dev/null +++ b/storage/ndb/src/old_files/client/odbc/driver/SQLExtendedFetch.cpp @@ -0,0 +1,59 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "driver.hpp" + +#if ODBCVER >= 0x0000 +SQLRETURN SQL_API +SQLExtendedFetch( + SQLHSTMT hstmt, + SQLUSMALLINT fFetchType, + SQLINTEGER irow, + SQLUINTEGER* pcrow, + SQLUSMALLINT* rgfRowStatus) +{ +#ifndef auto_SQLExtendedFetch + const char* const sqlFunction = "SQLExtendedFetch"; + Ctx ctx; + ctx_log1(("*** not implemented: %s", sqlFunction)); + return SQL_ERROR; +#else + driver_enter(SQL_API_SQLEXTENDEDFETCH); + const char* const sqlFunction = "SQLExtendedFetch"; + HandleRoot* const pRoot = HandleRoot::instance(); + HandleStmt* pStmt = pRoot->findStmt(hstmt); + if (pStmt == 0) { + driver_exit(SQL_API_SQLEXTENDEDFETCH); + return SQL_INVALID_HANDLE; + } + Ctx& ctx = *new Ctx; + ctx.logSqlEnter(sqlFunction); + if (ctx.ok()) + pStmt->sqlExtendedFetch( + ctx, + fFetchType, + irow, + &pcrow, + &rgfRowStatus + ); + pStmt->saveCtx(ctx); + ctx.logSqlExit(); + SQLRETURN ret = ctx.getCode(); + driver_exit(SQL_API_SQLEXTENDEDFETCH); + return ret; +#endif +} +#endif // ODBCVER >= 0x0000 diff --git a/storage/ndb/src/old_files/client/odbc/driver/SQLFetch.cpp b/storage/ndb/src/old_files/client/odbc/driver/SQLFetch.cpp new file mode 100644 index 00000000000..addba7b998c --- /dev/null +++ b/storage/ndb/src/old_files/client/odbc/driver/SQLFetch.cpp @@ -0,0 +1,45 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "driver.hpp" + +#if ODBCVER >= 0x0000 +SQLRETURN SQL_API +SQLFetch( + SQLHSTMT StatementHandle) +{ + driver_enter(SQL_API_SQLFETCH); + const char* const sqlFunction = "SQLFetch"; + HandleRoot* const pRoot = HandleRoot::instance(); + HandleStmt* pStmt = pRoot->findStmt(StatementHandle); + if (pStmt == 0) { + driver_exit(SQL_API_SQLFETCH); + return SQL_INVALID_HANDLE; + } + Ctx& ctx = *new Ctx; + ctx.logSqlEnter(sqlFunction); + try { + pStmt->sqlFetch(ctx); + } catch (CtxAssert& ctxAssert) { + ctx.handleEx(ctxAssert); + } + pStmt->saveCtx(ctx); + ctx.logSqlExit(); + SQLRETURN ret = ctx.getCode(); + driver_exit(SQL_API_SQLFETCH); + return ret; +} +#endif // ODBCVER >= 0x0000 diff --git a/storage/ndb/src/old_files/client/odbc/driver/SQLFetchScroll.cpp b/storage/ndb/src/old_files/client/odbc/driver/SQLFetchScroll.cpp new file mode 100644 index 00000000000..cfbfc813fca --- /dev/null +++ b/storage/ndb/src/old_files/client/odbc/driver/SQLFetchScroll.cpp @@ -0,0 +1,55 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "driver.hpp" + +#if ODBCVER >= 0x0300 +SQLRETURN SQL_API +SQLFetchScroll( + SQLHSTMT StatementHandle, + SQLSMALLINT FetchOrientation, + SQLINTEGER FetchOffset) +{ +#ifndef auto_SQLFetchScroll + const char* const sqlFunction = "SQLFetchScroll"; + Ctx ctx; + ctx_log1(("*** not implemented: %s", sqlFunction)); + return SQL_ERROR; +#else + driver_enter(SQL_API_SQLFETCHSCROLL); + const char* const sqlFunction = "SQLFetchScroll"; + HandleRoot* const pRoot = HandleRoot::instance(); + HandleStmt* pStmt = pRoot->findStmt(StatementHandle); + if (pStmt == 0) { + driver_exit(SQL_API_SQLFETCHSCROLL); + return SQL_INVALID_HANDLE; + } + Ctx& ctx = *new Ctx; + ctx.logSqlEnter(sqlFunction); + if (ctx.ok()) + pStmt->sqlFetchScroll( + ctx, + FetchOrientation, + FetchOffset + ); + pStmt->saveCtx(ctx); + ctx.logSqlExit(); + SQLRETURN ret = ctx.getCode(); + driver_exit(SQL_API_SQLFETCHSCROLL); + return ret; +#endif +} +#endif // ODBCVER >= 0x0300 diff --git a/storage/ndb/src/old_files/client/odbc/driver/SQLForeignKeys.cpp b/storage/ndb/src/old_files/client/odbc/driver/SQLForeignKeys.cpp new file mode 100644 index 00000000000..886ac6bdaa5 --- /dev/null +++ b/storage/ndb/src/old_files/client/odbc/driver/SQLForeignKeys.cpp @@ -0,0 +1,75 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "driver.hpp" + +#if ODBCVER >= 0x0000 +SQLRETURN SQL_API +SQLForeignKeys( + SQLHSTMT hstmt, + SQLCHAR* szPkCatalogName, + SQLSMALLINT cbPkCatalogName, + SQLCHAR* szPkSchemaName, + SQLSMALLINT cbPkSchemaName, + SQLCHAR* szPkTableName, + SQLSMALLINT cbPkTableName, + SQLCHAR* szFkCatalogName, + SQLSMALLINT cbFkCatalogName, + SQLCHAR* szFkSchemaName, + SQLSMALLINT cbFkSchemaName, + SQLCHAR* szFkTableName, + SQLSMALLINT cbFkTableName) +{ +#ifndef auto_SQLForeignKeys + const char* const sqlFunction = "SQLForeignKeys"; + Ctx ctx; + ctx_log1(("*** not implemented: %s", sqlFunction)); + return SQL_ERROR; +#else + driver_enter(SQL_API_SQLFOREIGNKEYS); + const char* const sqlFunction = "SQLForeignKeys"; + HandleRoot* const pRoot = HandleRoot::instance(); + HandleStmt* pStmt = pRoot->findStmt(hstmt); + if (pStmt == 0) { + driver_exit(SQL_API_SQLFOREIGNKEYS); + return SQL_INVALID_HANDLE; + } + Ctx& ctx = *new Ctx; + ctx.logSqlEnter(sqlFunction); + if (ctx.ok()) + pStmt->sqlForeignKeys( + ctx, + &szPkCatalogName, + cbPkCatalogName, + &szPkSchemaName, + cbPkSchemaName, + &szPkTableName, + cbPkTableName, + &szFkCatalogName, + cbFkCatalogName, + &szFkSchemaName, + cbFkSchemaName, + &szFkTableName, + cbFkTableName + ); + pStmt->saveCtx(ctx); + ctx.logSqlExit(); + SQLRETURN ret = ctx.getCode(); + driver_exit(SQL_API_SQLFOREIGNKEYS); + return ret; +#endif +} +#endif // ODBCVER >= 0x0000 diff --git a/storage/ndb/src/old_files/client/odbc/driver/SQLFreeConnect.cpp b/storage/ndb/src/old_files/client/odbc/driver/SQLFreeConnect.cpp new file mode 100644 index 00000000000..9ac84710cce --- /dev/null +++ b/storage/ndb/src/old_files/client/odbc/driver/SQLFreeConnect.cpp @@ -0,0 +1,53 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "driver.hpp" + +#if ODBCVER >= 0x0000 +SQLRETURN SQL_API +SQLFreeConnect( + SQLHDBC ConnectionHandle) +{ + driver_enter(SQL_API_SQLFREECONNECT); + const char* const sqlFunction = "SQLFreeConnect"; + HandleRoot* const pRoot = HandleRoot::instance(); + HandleDbc* pDbc = pRoot->findDbc(ConnectionHandle); + if (pDbc == 0) { + driver_exit(SQL_API_SQLFREECONNECT); + return SQL_INVALID_HANDLE; + } + Ctx& ctx = *new Ctx; + ctx.logSqlEnter(sqlFunction); + HandleEnv* pEnv = pDbc->getEnv(); + try { + pEnv->sqlFreeConnect(ctx, pDbc); + } catch (CtxAssert& ctxAssert) { + ctx.handleEx(ctxAssert); + } + if (! ctx.ok()) { + pDbc->saveCtx(ctx); + ctx.logSqlExit(); + SQLRETURN ret = ctx.getCode(); + driver_exit(SQL_API_SQLFREECONNECT); + return ret; + } + ctx.logSqlExit(); + SQLRETURN ret = ctx.getCode(); + delete &ctx; + driver_exit(SQL_API_SQLFREECONNECT); + return ret; +} +#endif // ODBCVER >= 0x0000 diff --git a/storage/ndb/src/old_files/client/odbc/driver/SQLFreeEnv.cpp b/storage/ndb/src/old_files/client/odbc/driver/SQLFreeEnv.cpp new file mode 100644 index 00000000000..7e35056feb5 --- /dev/null +++ b/storage/ndb/src/old_files/client/odbc/driver/SQLFreeEnv.cpp @@ -0,0 +1,52 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "driver.hpp" + +#if ODBCVER >= 0x0000 +SQLRETURN SQL_API +SQLFreeEnv( + SQLHENV EnvironmentHandle) +{ + driver_enter(SQL_API_SQLFREEENV); + const char* const sqlFunction = "SQLFreeEnv"; + HandleRoot* const pRoot = HandleRoot::instance(); + HandleEnv* pEnv = pRoot->findEnv(EnvironmentHandle); + if (pEnv == 0) { + driver_exit(SQL_API_SQLFREEENV); + return SQL_INVALID_HANDLE; + } + Ctx& ctx = *new Ctx; + ctx.logSqlEnter(sqlFunction); + try { + pRoot->sqlFreeEnv(ctx, pEnv); + } catch (CtxAssert& ctxAssert) { + ctx.handleEx(ctxAssert); + } + if (! ctx.ok()) { + pEnv->saveCtx(ctx); + ctx.logSqlExit(); + SQLRETURN ret = ctx.getCode(); + driver_exit(SQL_API_SQLFREEENV); + return ret; + } + ctx.logSqlExit(); + SQLRETURN ret = ctx.getCode(); + delete &ctx; + driver_exit(SQL_API_SQLFREEENV); + return ret; +} +#endif // ODBCVER >= 0x0000 diff --git a/storage/ndb/src/old_files/client/odbc/driver/SQLFreeHandle.cpp b/storage/ndb/src/old_files/client/odbc/driver/SQLFreeHandle.cpp new file mode 100644 index 00000000000..284463cbb07 --- /dev/null +++ b/storage/ndb/src/old_files/client/odbc/driver/SQLFreeHandle.cpp @@ -0,0 +1,60 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "driver.hpp" + +#if ODBCVER >= 0x0300 +SQLRETURN SQL_API +SQLFreeHandle( + SQLSMALLINT HandleType, + SQLHANDLE Handle) +{ + driver_enter(SQL_API_SQLFREEHANDLE); + const char* const sqlFunction = "SQLFreeHandle"; + HandleRoot* const pRoot = HandleRoot::instance(); + SQLSMALLINT parentType = pRoot->findParentType(HandleType); + if (parentType == -1) { + driver_exit(SQL_API_SQLFREEHANDLE); + return SQL_INVALID_HANDLE; + } + HandleBase* pChild = pRoot->findBase(HandleType, Handle); + if (pChild == 0) { + driver_exit(SQL_API_SQLFREEHANDLE); + return SQL_INVALID_HANDLE; + } + Ctx& ctx = *new Ctx; + ctx.logSqlEnter(sqlFunction); + HandleBase* pParent = pChild->getParent(); + ctx_assert(pParent != 0); + try { + pParent->sqlFreeHandle(ctx, HandleType, pChild); + } catch (CtxAssert& ctxAssert) { + ctx.handleEx(ctxAssert); + } + if (! ctx.ok()) { + pChild->saveCtx(ctx); + ctx.logSqlExit(); + SQLRETURN ret = ctx.getCode(); + driver_exit(SQL_API_SQLFREEHANDLE); + return ret; + } + ctx.logSqlExit(); + SQLRETURN ret = ctx.getCode(); + delete &ctx; + driver_exit(SQL_API_SQLFREEHANDLE); + return ret; +} +#endif // ODBCVER >= 0x0300 diff --git a/storage/ndb/src/old_files/client/odbc/driver/SQLFreeStmt.cpp b/storage/ndb/src/old_files/client/odbc/driver/SQLFreeStmt.cpp new file mode 100644 index 00000000000..7af6623a37a --- /dev/null +++ b/storage/ndb/src/old_files/client/odbc/driver/SQLFreeStmt.cpp @@ -0,0 +1,54 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "driver.hpp" + +#if ODBCVER >= 0x0000 +SQLRETURN SQL_API +SQLFreeStmt( + SQLHSTMT StatementHandle, + SQLUSMALLINT Option) +{ + driver_enter(SQL_API_SQLFREESTMT); + const char* const sqlFunction = "SQLFreeStmt"; + HandleRoot* const pRoot = HandleRoot::instance(); + HandleStmt* pStmt = pRoot->findStmt(StatementHandle); + if (pStmt == 0) { + driver_exit(SQL_API_SQLFREESTMT); + return SQL_INVALID_HANDLE; + } + Ctx& ctx = *new Ctx; + ctx.logSqlEnter(sqlFunction); + HandleDbc* pDbc = pStmt->getDbc(); + try { + pDbc->sqlFreeStmt(ctx, pStmt, Option); + } catch (CtxAssert& ctxAssert) { + ctx.handleEx(ctxAssert); + } + if (! ctx.ok() || Option != SQL_DROP) { + pStmt->saveCtx(ctx); + ctx.logSqlExit(); + SQLRETURN ret = ctx.getCode(); + driver_exit(SQL_API_SQLFREESTMT); + return ret; + } + ctx.logSqlExit(); + SQLRETURN ret = ctx.getCode(); + delete &ctx; + driver_exit(SQL_API_SQLFREESTMT); + return ret; +} +#endif // ODBCVER >= 0x0000 diff --git a/storage/ndb/src/old_files/client/odbc/driver/SQLGetConnectAttr.cpp b/storage/ndb/src/old_files/client/odbc/driver/SQLGetConnectAttr.cpp new file mode 100644 index 00000000000..66c1f3827e1 --- /dev/null +++ b/storage/ndb/src/old_files/client/odbc/driver/SQLGetConnectAttr.cpp @@ -0,0 +1,49 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "driver.hpp" + +#if ODBCVER >= 0x0300 +SQLRETURN SQL_API +SQLGetConnectAttr( + SQLHDBC ConnectionHandle, + SQLINTEGER Attribute, + SQLPOINTER Value, + SQLINTEGER BufferLength, + SQLINTEGER* StringLength) +{ + driver_enter(SQL_API_SQLGETCONNECTATTR); + const char* const sqlFunction = "SQLGetConnectAttr"; + HandleRoot* const pRoot = HandleRoot::instance(); + HandleDbc* pDbc = pRoot->findDbc(ConnectionHandle); + if (pDbc == 0) { + driver_exit(SQL_API_SQLGETCONNECTATTR); + return SQL_INVALID_HANDLE; + } + Ctx& ctx = *new Ctx; + ctx.logSqlEnter(sqlFunction); + try { + pDbc->sqlGetConnectAttr(ctx, Attribute, Value, BufferLength, StringLength); + } catch (CtxAssert& ctxAssert) { + ctx.handleEx(ctxAssert); + } + pDbc->saveCtx(ctx); + ctx.logSqlExit(); + SQLRETURN ret = ctx.getCode(); + driver_exit(SQL_API_SQLGETCONNECTATTR); + return ret; +} +#endif // ODBCVER >= 0x0300 diff --git a/storage/ndb/src/old_files/client/odbc/driver/SQLGetConnectOption.cpp b/storage/ndb/src/old_files/client/odbc/driver/SQLGetConnectOption.cpp new file mode 100644 index 00000000000..514bedb12b9 --- /dev/null +++ b/storage/ndb/src/old_files/client/odbc/driver/SQLGetConnectOption.cpp @@ -0,0 +1,47 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "driver.hpp" + +#if ODBCVER >= 0x0000 +SQLRETURN SQL_API +SQLGetConnectOption( + SQLHDBC ConnectionHandle, + SQLUSMALLINT Option, + SQLPOINTER Value) +{ + driver_enter(SQL_API_SQLGETCONNECTOPTION); + const char* const sqlFunction = "SQLGetConnectOption"; + HandleRoot* const pRoot = HandleRoot::instance(); + HandleDbc* pDbc = pRoot->findDbc(ConnectionHandle); + if (pDbc == 0) { + driver_exit(SQL_API_SQLGETCONNECTOPTION); + return SQL_INVALID_HANDLE; + } + Ctx& ctx = *new Ctx; + ctx.logSqlEnter(sqlFunction); + try { + pDbc->sqlGetConnectOption(ctx, Option, Value); + } catch (CtxAssert& ctxAssert) { + ctx.handleEx(ctxAssert); + } + pDbc->saveCtx(ctx); + ctx.logSqlExit(); + SQLRETURN ret = ctx.getCode(); + driver_exit(SQL_API_SQLGETCONNECTOPTION); + return ret; +} +#endif // ODBCVER >= 0x0000 diff --git a/storage/ndb/src/old_files/client/odbc/driver/SQLGetCursorName.cpp b/storage/ndb/src/old_files/client/odbc/driver/SQLGetCursorName.cpp new file mode 100644 index 00000000000..d54bdf42005 --- /dev/null +++ b/storage/ndb/src/old_files/client/odbc/driver/SQLGetCursorName.cpp @@ -0,0 +1,48 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "driver.hpp" + +#if ODBCVER >= 0x0000 +SQLRETURN SQL_API +SQLGetCursorName( + SQLHSTMT StatementHandle, + SQLCHAR* CursorName, + SQLSMALLINT BufferLength, + SQLSMALLINT* NameLength) +{ + driver_enter(SQL_API_SQLGETCURSORNAME); + const char* const sqlFunction = "SQLGetCursorName"; + HandleRoot* const pRoot = HandleRoot::instance(); + HandleStmt* pStmt = pRoot->findStmt(StatementHandle); + if (pStmt == 0) { + driver_exit(SQL_API_SQLGETCURSORNAME); + return SQL_INVALID_HANDLE; + } + Ctx& ctx = *new Ctx; + ctx.logSqlEnter(sqlFunction); + try { + pStmt->sqlGetCursorName(ctx, CursorName, BufferLength, NameLength); + } catch (CtxAssert& ctxAssert) { + ctx.handleEx(ctxAssert); + } + pStmt->saveCtx(ctx); + ctx.logSqlExit(); + SQLRETURN ret = ctx.getCode(); + driver_exit(SQL_API_SQLGETCURSORNAME); + return ret; +} +#endif // ODBCVER >= 0x0000 diff --git a/storage/ndb/src/old_files/client/odbc/driver/SQLGetData.cpp b/storage/ndb/src/old_files/client/odbc/driver/SQLGetData.cpp new file mode 100644 index 00000000000..3b6987c515d --- /dev/null +++ b/storage/ndb/src/old_files/client/odbc/driver/SQLGetData.cpp @@ -0,0 +1,50 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "driver.hpp" + +#if ODBCVER >= 0x0000 +SQLRETURN SQL_API +SQLGetData( + SQLHSTMT StatementHandle, + SQLUSMALLINT ColumnNumber, + SQLSMALLINT TargetType, + SQLPOINTER TargetValue, + SQLINTEGER BufferLength, + SQLINTEGER* StrLen_or_Ind) +{ + driver_enter(SQL_API_SQLGETDATA); + const char* const sqlFunction = "SQLGetData"; + HandleRoot* const pRoot = HandleRoot::instance(); + HandleStmt* pStmt = pRoot->findStmt(StatementHandle); + if (pStmt == 0) { + driver_exit(SQL_API_SQLGETDATA); + return SQL_INVALID_HANDLE; + } + Ctx& ctx = *new Ctx; + ctx.logSqlEnter(sqlFunction); + try { + pStmt->sqlGetData(ctx, ColumnNumber, TargetType, TargetValue, BufferLength, StrLen_or_Ind); + } catch (CtxAssert& ctxAssert) { + ctx.handleEx(ctxAssert); + } + pStmt->saveCtx(ctx); + ctx.logSqlExit(); + SQLRETURN ret = ctx.getCode(); + driver_exit(SQL_API_SQLGETDATA); + return ret; +} +#endif // ODBCVER >= 0x0000 diff --git a/storage/ndb/src/old_files/client/odbc/driver/SQLGetDescField.cpp b/storage/ndb/src/old_files/client/odbc/driver/SQLGetDescField.cpp new file mode 100644 index 00000000000..6cc390a58ed --- /dev/null +++ b/storage/ndb/src/old_files/client/odbc/driver/SQLGetDescField.cpp @@ -0,0 +1,50 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "driver.hpp" + +#if ODBCVER >= 0x0300 +SQLRETURN SQL_API +SQLGetDescField( + SQLHDESC DescriptorHandle, + SQLSMALLINT RecNumber, + SQLSMALLINT FieldIdentifier, + SQLPOINTER Value, + SQLINTEGER BufferLength, + SQLINTEGER* StringLength) +{ + driver_enter(SQL_API_SQLGETDESCFIELD); + const char* const sqlFunction = "SQLGetDescField"; + HandleRoot* const pRoot = HandleRoot::instance(); + HandleDesc* pDesc = pRoot->findDesc(DescriptorHandle); + if (pDesc == 0) { + driver_exit(SQL_API_SQLGETDESCFIELD); + return SQL_INVALID_HANDLE; + } + Ctx& ctx = *new Ctx; + ctx.logSqlEnter(sqlFunction); + try { + pDesc->sqlGetDescField(ctx, RecNumber, FieldIdentifier, Value, BufferLength, StringLength); + } catch (CtxAssert& ctxAssert) { + ctx.handleEx(ctxAssert); + } + pDesc->saveCtx(ctx); + ctx.logSqlExit(); + SQLRETURN ret = ctx.getCode(); + driver_exit(SQL_API_SQLGETDESCFIELD); + return ret; +} +#endif // ODBCVER >= 0x0300 diff --git a/storage/ndb/src/old_files/client/odbc/driver/SQLGetDescRec.cpp b/storage/ndb/src/old_files/client/odbc/driver/SQLGetDescRec.cpp new file mode 100644 index 00000000000..c7e9631b075 --- /dev/null +++ b/storage/ndb/src/old_files/client/odbc/driver/SQLGetDescRec.cpp @@ -0,0 +1,55 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "driver.hpp" + +#if ODBCVER >= 0x0300 +SQLRETURN SQL_API +SQLGetDescRec( + SQLHDESC DescriptorHandle, + SQLSMALLINT RecNumber, + SQLCHAR* Name, + SQLSMALLINT BufferLength, + SQLSMALLINT* StringLength, + SQLSMALLINT* Type, + SQLSMALLINT* SubType, + SQLINTEGER* Length, + SQLSMALLINT* Precision, + SQLSMALLINT* Scale, + SQLSMALLINT* Nullable) +{ + driver_enter(SQL_API_SQLGETDESCREC); + const char* const sqlFunction = "SQLGetDescRec"; + HandleRoot* const pRoot = HandleRoot::instance(); + HandleDesc* pDesc = pRoot->findDesc(DescriptorHandle); + if (pDesc == 0) { + driver_exit(SQL_API_SQLGETDESCREC); + return SQL_INVALID_HANDLE; + } + Ctx& ctx = *new Ctx; + ctx.logSqlEnter(sqlFunction); + try { + pDesc->sqlGetDescRec(ctx, RecNumber, Name, BufferLength, StringLength, Type, SubType, Length, Precision, Scale, Nullable); + } catch (CtxAssert& ctxAssert) { + ctx.handleEx(ctxAssert); + } + pDesc->saveCtx(ctx); + ctx.logSqlExit(); + SQLRETURN ret = ctx.getCode(); + driver_exit(SQL_API_SQLGETDESCREC); + return ret; +} +#endif // ODBCVER >= 0x0300 diff --git a/storage/ndb/src/old_files/client/odbc/driver/SQLGetDiagField.cpp b/storage/ndb/src/old_files/client/odbc/driver/SQLGetDiagField.cpp new file mode 100644 index 00000000000..3eb34f7ebf6 --- /dev/null +++ b/storage/ndb/src/old_files/client/odbc/driver/SQLGetDiagField.cpp @@ -0,0 +1,50 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "driver.hpp" + +#if ODBCVER >= 0x0300 +SQLRETURN SQL_API +SQLGetDiagField( + SQLSMALLINT HandleType, + SQLHANDLE Handle, + SQLSMALLINT RecNumber, + SQLSMALLINT DiagIdentifier, + SQLPOINTER DiagInfo, + SQLSMALLINT BufferLength, + SQLSMALLINT* StringLength) +{ + driver_enter(SQL_API_SQLGETDIAGFIELD); + const char* const sqlFunction = "SQLGetDiagField"; + HandleRoot* const pRoot = HandleRoot::instance(); + HandleBase* pBase = pRoot->findBase(HandleType, Handle); + if (pBase == 0) { + driver_exit(SQL_API_SQLGETDIAGFIELD); + return SQL_INVALID_HANDLE; + } + Ctx ctx; // discard diagnostics + ctx.logSqlEnter(sqlFunction); + try { + pBase->sqlGetDiagField(ctx, RecNumber, DiagIdentifier, DiagInfo, BufferLength, StringLength); + } catch (CtxAssert& ctxAssert) { + ctx.handleEx(ctxAssert); + } + ctx.logSqlExit(); + SQLRETURN ret = ctx.getCode(); + driver_exit(SQL_API_SQLGETDIAGFIELD); + return ret; +} +#endif // ODBCVER >= 0x0300 diff --git a/storage/ndb/src/old_files/client/odbc/driver/SQLGetDiagRec.cpp b/storage/ndb/src/old_files/client/odbc/driver/SQLGetDiagRec.cpp new file mode 100644 index 00000000000..448c5206d76 --- /dev/null +++ b/storage/ndb/src/old_files/client/odbc/driver/SQLGetDiagRec.cpp @@ -0,0 +1,51 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "driver.hpp" + +#if ODBCVER >= 0x0300 +SQLRETURN SQL_API +SQLGetDiagRec( + SQLSMALLINT HandleType, + SQLHANDLE Handle, + SQLSMALLINT RecNumber, + SQLCHAR* Sqlstate, + SQLINTEGER* NativeError, + SQLCHAR* MessageText, + SQLSMALLINT BufferLength, + SQLSMALLINT* TextLength) +{ + driver_enter(SQL_API_SQLGETDIAGREC); + const char* const sqlFunction = "SQLGetDiagRec"; + HandleRoot* const pRoot = HandleRoot::instance(); + HandleBase* pBase = pRoot->findBase(HandleType, Handle); + if (pBase == 0) { + driver_exit(SQL_API_SQLGETDIAGREC); + return SQL_INVALID_HANDLE; + } + Ctx ctx; // discard diagnostics + ctx.logSqlEnter(sqlFunction); + try { + pBase->sqlGetDiagRec(ctx, RecNumber, Sqlstate, NativeError, MessageText, BufferLength, TextLength); + } catch (CtxAssert& ctxAssert) { + ctx.handleEx(ctxAssert); + } + ctx.logSqlExit(); + SQLRETURN ret = ctx.getCode(); + driver_exit(SQL_API_SQLGETDIAGREC); + return ret; +} +#endif // ODBCVER >= 0x0300 diff --git a/storage/ndb/src/old_files/client/odbc/driver/SQLGetEnvAttr.cpp b/storage/ndb/src/old_files/client/odbc/driver/SQLGetEnvAttr.cpp new file mode 100644 index 00000000000..c93870326e4 --- /dev/null +++ b/storage/ndb/src/old_files/client/odbc/driver/SQLGetEnvAttr.cpp @@ -0,0 +1,66 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "driver.hpp" + +#if ODBCVER >= 0x0300 +SQLRETURN SQL_API +SQLGetEnvAttr( + SQLHENV EnvironmentHandle, + SQLINTEGER Attribute, + SQLPOINTER Value, + SQLINTEGER BufferLength, + SQLINTEGER* StringLength) +{ + driver_enter(SQL_API_SQLGETENVATTR); + const char* const sqlFunction = "SQLGetEnvAttr"; + HandleRoot* const pRoot = HandleRoot::instance(); + if (EnvironmentHandle == 0) { + // process-level attributes + Ctx& ctx = *new Ctx; + ctx.logSqlEnter(sqlFunction); + try { + pRoot->sqlGetRootAttr(ctx, Attribute, Value, BufferLength, StringLength); + } catch (CtxAssert& ctxAssert) { + ctx.handleEx(ctxAssert); + } + pRoot->saveCtx(ctx); + ctx.logSqlExit(); + SQLRETURN ret = ctx.getCode(); + driver_exit(SQL_API_SQLGETENVATTR); + return ret; + } else { + HandleEnv* pEnv = pRoot->findEnv(EnvironmentHandle); + if (pEnv == 0) { + driver_exit(SQL_API_SQLGETENVATTR); + return SQL_INVALID_HANDLE; + } + Ctx& ctx = *new Ctx; + ctx.logSqlEnter(sqlFunction); + try { + pEnv->sqlGetEnvAttr(ctx, Attribute, Value, BufferLength, StringLength); + } catch (CtxAssert& ctxAssert) { + ctx.handleEx(ctxAssert); + } + pEnv->saveCtx(ctx); + ctx.logSqlExit(); + SQLRETURN ret = ctx.getCode(); + driver_exit(SQL_API_SQLGETENVATTR); + return ret; + } + return SQL_ERROR; // not reached +} +#endif // ODBCVER >= 0x0300 diff --git a/storage/ndb/src/old_files/client/odbc/driver/SQLGetFunctions.cpp b/storage/ndb/src/old_files/client/odbc/driver/SQLGetFunctions.cpp new file mode 100644 index 00000000000..68416fab1a6 --- /dev/null +++ b/storage/ndb/src/old_files/client/odbc/driver/SQLGetFunctions.cpp @@ -0,0 +1,47 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "driver.hpp" + +#if ODBCVER >= 0x0000 +SQLRETURN SQL_API +SQLGetFunctions( + SQLHDBC ConnectionHandle, + SQLUSMALLINT FunctionId, + SQLUSMALLINT* Supported) +{ + driver_enter(SQL_API_SQLGETFUNCTIONS); + const char* const sqlFunction = "SQLGetFunctions"; + HandleRoot* const pRoot = HandleRoot::instance(); + HandleDbc* pDbc = pRoot->findDbc(ConnectionHandle); + if (pDbc == 0) { + driver_exit(SQL_API_SQLGETFUNCTIONS); + return SQL_INVALID_HANDLE; + } + Ctx& ctx = *new Ctx; + ctx.logSqlEnter(sqlFunction); + try { + pDbc->sqlGetFunctions(ctx, FunctionId, Supported); + } catch (CtxAssert& ctxAssert) { + ctx.handleEx(ctxAssert); + } + pDbc->saveCtx(ctx); + ctx.logSqlExit(); + SQLRETURN ret = ctx.getCode(); + driver_exit(SQL_API_SQLGETFUNCTIONS); + return ret; +} +#endif // ODBCVER >= 0x0000 diff --git a/storage/ndb/src/old_files/client/odbc/driver/SQLGetInfo.cpp b/storage/ndb/src/old_files/client/odbc/driver/SQLGetInfo.cpp new file mode 100644 index 00000000000..8f0a0d67cfa --- /dev/null +++ b/storage/ndb/src/old_files/client/odbc/driver/SQLGetInfo.cpp @@ -0,0 +1,49 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "driver.hpp" + +#if ODBCVER >= 0x0000 +SQLRETURN SQL_API +SQLGetInfo( + SQLHDBC ConnectionHandle, + SQLUSMALLINT InfoType, + SQLPOINTER InfoValue, + SQLSMALLINT BufferLength, + SQLSMALLINT* StringLength) +{ + driver_enter(SQL_API_SQLGETINFO); + const char* const sqlFunction = "SQLGetInfo"; + HandleRoot* const pRoot = HandleRoot::instance(); + HandleDbc* pDbc = pRoot->findDbc(ConnectionHandle); + if (pDbc == 0) { + driver_exit(SQL_API_SQLGETINFO); + return SQL_INVALID_HANDLE; + } + Ctx& ctx = *new Ctx; + ctx.logSqlEnter(sqlFunction); + try { + pDbc->sqlGetInfo(ctx, InfoType, InfoValue, BufferLength, StringLength); + } catch (CtxAssert& ctxAssert) { + ctx.handleEx(ctxAssert); + } + pDbc->saveCtx(ctx); + ctx.logSqlExit(); + SQLRETURN ret = ctx.getCode(); + driver_exit(SQL_API_SQLGETINFO); + return ret; +} +#endif // ODBCVER >= 0x0000 diff --git a/storage/ndb/src/old_files/client/odbc/driver/SQLGetStmtAttr.cpp b/storage/ndb/src/old_files/client/odbc/driver/SQLGetStmtAttr.cpp new file mode 100644 index 00000000000..990ab68808a --- /dev/null +++ b/storage/ndb/src/old_files/client/odbc/driver/SQLGetStmtAttr.cpp @@ -0,0 +1,49 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "driver.hpp" + +#if ODBCVER >= 0x0300 +SQLRETURN SQL_API +SQLGetStmtAttr( + SQLHSTMT StatementHandle, + SQLINTEGER Attribute, + SQLPOINTER Value, + SQLINTEGER BufferLength, + SQLINTEGER* StringLength) +{ + driver_enter(SQL_API_SQLGETSTMTATTR); + const char* const sqlFunction = "SQLGetStmtAttr"; + HandleRoot* const pRoot = HandleRoot::instance(); + HandleStmt* pStmt = pRoot->findStmt(StatementHandle); + if (pStmt == 0) { + driver_exit(SQL_API_SQLGETSTMTATTR); + return SQL_INVALID_HANDLE; + } + Ctx& ctx = *new Ctx; + ctx.logSqlEnter(sqlFunction); + try { + pStmt->sqlGetStmtAttr(ctx, Attribute, Value, BufferLength, StringLength); + } catch (CtxAssert& ctxAssert) { + ctx.handleEx(ctxAssert); + } + pStmt->saveCtx(ctx); + ctx.logSqlExit(); + SQLRETURN ret = ctx.getCode(); + driver_exit(SQL_API_SQLGETSTMTATTR); + return ret; +} +#endif // ODBCVER >= 0x0300 diff --git a/storage/ndb/src/old_files/client/odbc/driver/SQLGetStmtOption.cpp b/storage/ndb/src/old_files/client/odbc/driver/SQLGetStmtOption.cpp new file mode 100644 index 00000000000..0b5758b1212 --- /dev/null +++ b/storage/ndb/src/old_files/client/odbc/driver/SQLGetStmtOption.cpp @@ -0,0 +1,47 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "driver.hpp" + +#if ODBCVER >= 0x0000 +SQLRETURN SQL_API +SQLGetStmtOption( + SQLHSTMT StatementHandle, + SQLUSMALLINT Option, + SQLPOINTER Value) +{ + driver_enter(SQL_API_SQLGETSTMTOPTION); + const char* const sqlFunction = "SQLGetStmtOption"; + HandleRoot* const pRoot = HandleRoot::instance(); + HandleStmt* pStmt = pRoot->findStmt(StatementHandle); + if (pStmt == 0) { + driver_exit(SQL_API_SQLGETSTMTOPTION); + return SQL_INVALID_HANDLE; + } + Ctx& ctx = *new Ctx; + ctx.logSqlEnter(sqlFunction); + try { + pStmt->sqlGetStmtOption(ctx, Option, Value); + } catch (CtxAssert& ctxAssert) { + ctx.handleEx(ctxAssert); + } + pStmt->saveCtx(ctx); + ctx.logSqlExit(); + SQLRETURN ret = ctx.getCode(); + driver_exit(SQL_API_SQLGETSTMTOPTION); + return ret; +} +#endif // ODBCVER >= 0x0000 diff --git a/storage/ndb/src/old_files/client/odbc/driver/SQLGetTypeInfo.cpp b/storage/ndb/src/old_files/client/odbc/driver/SQLGetTypeInfo.cpp new file mode 100644 index 00000000000..e6a016cc400 --- /dev/null +++ b/storage/ndb/src/old_files/client/odbc/driver/SQLGetTypeInfo.cpp @@ -0,0 +1,46 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "driver.hpp" + +#if ODBCVER >= 0x0000 +SQLRETURN SQL_API +SQLGetTypeInfo( + SQLHSTMT StatementHandle, + SQLSMALLINT DataType) +{ + driver_enter(SQL_API_SQLGETTYPEINFO); + const char* const sqlFunction = "SQLGetTypeInfo"; + HandleRoot* const pRoot = HandleRoot::instance(); + HandleStmt* pStmt = pRoot->findStmt(StatementHandle); + if (pStmt == 0) { + driver_exit(SQL_API_SQLGETTYPEINFO); + return SQL_INVALID_HANDLE; + } + Ctx& ctx = *new Ctx; + ctx.logSqlEnter(sqlFunction); + try { + pStmt->sqlGetTypeInfo(ctx, DataType); + } catch (CtxAssert& ctxAssert) { + ctx.handleEx(ctxAssert); + } + pStmt->saveCtx(ctx); + ctx.logSqlExit(); + SQLRETURN ret = ctx.getCode(); + driver_exit(SQL_API_SQLGETTYPEINFO); + return ret; +} +#endif // ODBCVER >= 0x0000 diff --git a/storage/ndb/src/old_files/client/odbc/driver/SQLMoreResults.cpp b/storage/ndb/src/old_files/client/odbc/driver/SQLMoreResults.cpp new file mode 100644 index 00000000000..d23d653a319 --- /dev/null +++ b/storage/ndb/src/old_files/client/odbc/driver/SQLMoreResults.cpp @@ -0,0 +1,42 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "driver.hpp" + +#if ODBCVER >= 0x0000 +SQLRETURN SQL_API +SQLMoreResults( + SQLHSTMT hstmt) +{ + driver_enter(SQL_API_SQLMORERESULTS); + const char* const sqlFunction = "SQLMoreResults"; + HandleRoot* const pRoot = HandleRoot::instance(); + HandleStmt* pStmt = pRoot->findStmt(hstmt); + if (pStmt == 0) { + driver_exit(SQL_API_SQLMORERESULTS); + return SQL_INVALID_HANDLE; + } + Ctx& ctx = *new Ctx; + ctx.logSqlEnter(sqlFunction); + if (ctx.ok()) + pStmt->sqlMoreResults(ctx); + pStmt->saveCtx(ctx); + ctx.logSqlExit(); + SQLRETURN ret = ctx.getCode(); + driver_exit(SQL_API_SQLMORERESULTS); + return ret; +} +#endif // ODBCVER >= 0x0000 diff --git a/storage/ndb/src/old_files/client/odbc/driver/SQLNativeSql.cpp b/storage/ndb/src/old_files/client/odbc/driver/SQLNativeSql.cpp new file mode 100644 index 00000000000..fb8a9bbf3d9 --- /dev/null +++ b/storage/ndb/src/old_files/client/odbc/driver/SQLNativeSql.cpp @@ -0,0 +1,61 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "driver.hpp" + +#if ODBCVER >= 0x0000 +SQLRETURN SQL_API +SQLNativeSql( + SQLHDBC hdbc, + SQLCHAR* szSqlStrIn, + SQLINTEGER cbSqlStrIn, + SQLCHAR* szSqlStr, + SQLINTEGER cbSqlStrMax, + SQLINTEGER* pcbSqlStr) +{ +#ifndef auto_SQLNativeSql + const char* const sqlFunction = "SQLNativeSql"; + Ctx ctx; + ctx_log1(("*** not implemented: %s", sqlFunction)); + return SQL_ERROR; +#else + driver_enter(SQL_API_SQLNATIVESQL); + const char* const sqlFunction = "SQLNativeSql"; + HandleRoot* const pRoot = HandleRoot::instance(); + HandleDbc* pDbc = pRoot->findDbc(hdbc); + if (pDbc == 0) { + driver_exit(SQL_API_SQLNATIVESQL); + return SQL_INVALID_HANDLE; + } + Ctx& ctx = *new Ctx; + ctx.logSqlEnter(sqlFunction); + if (ctx.ok()) + pDbc->sqlNativeSql( + ctx, + &szSqlStrIn, + cbSqlStrIn, + &szSqlStr, + cbSqlStrMax, + &pcbSqlStr + ); + pDbc->saveCtx(ctx); + ctx.logSqlExit(); + SQLRETURN ret = ctx.getCode(); + driver_exit(SQL_API_SQLNATIVESQL); + return ret; +#endif +} +#endif // ODBCVER >= 0x0000 diff --git a/storage/ndb/src/old_files/client/odbc/driver/SQLNumParams.cpp b/storage/ndb/src/old_files/client/odbc/driver/SQLNumParams.cpp new file mode 100644 index 00000000000..7b1a6a07aec --- /dev/null +++ b/storage/ndb/src/old_files/client/odbc/driver/SQLNumParams.cpp @@ -0,0 +1,46 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "driver.hpp" + +#if ODBCVER >= 0x0000 +SQLRETURN SQL_API +SQLNumParams( + SQLHSTMT StatementHandle, + SQLSMALLINT* ParameterCountPtr) +{ + driver_enter(SQL_API_SQLNUMPARAMS); + const char* const sqlFunction = "SQLNumParams"; + HandleRoot* const pRoot = HandleRoot::instance(); + HandleStmt* pStmt = pRoot->findStmt(StatementHandle); + if (pStmt == 0) { + driver_exit(SQL_API_SQLNUMPARAMS); + return SQL_INVALID_HANDLE; + } + Ctx& ctx = *new Ctx; + ctx.logSqlEnter(sqlFunction); + try { + pStmt->sqlNumParams(ctx, ParameterCountPtr); + } catch (CtxAssert& ctxAssert) { + ctx.handleEx(ctxAssert); + } + pStmt->saveCtx(ctx); + ctx.logSqlExit(); + SQLRETURN ret = ctx.getCode(); + driver_exit(SQL_API_SQLNUMPARAMS); + return ret; +} +#endif // ODBCVER >= 0x0000 diff --git a/storage/ndb/src/old_files/client/odbc/driver/SQLNumResultCols.cpp b/storage/ndb/src/old_files/client/odbc/driver/SQLNumResultCols.cpp new file mode 100644 index 00000000000..2e70897a9a2 --- /dev/null +++ b/storage/ndb/src/old_files/client/odbc/driver/SQLNumResultCols.cpp @@ -0,0 +1,46 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "driver.hpp" + +#if ODBCVER >= 0x0000 +SQLRETURN SQL_API +SQLNumResultCols( + SQLHSTMT StatementHandle, + SQLSMALLINT* ColumnCount) +{ + driver_enter(SQL_API_SQLNUMRESULTCOLS); + const char* const sqlFunction = "SQLNumResultCols"; + HandleRoot* const pRoot = HandleRoot::instance(); + HandleStmt* pStmt = pRoot->findStmt(StatementHandle); + if (pStmt == 0) { + driver_exit(SQL_API_SQLNUMRESULTCOLS); + return SQL_INVALID_HANDLE; + } + Ctx& ctx = *new Ctx; + ctx.logSqlEnter(sqlFunction); + try { + pStmt->sqlNumResultCols(ctx, ColumnCount); + } catch (CtxAssert& ctxAssert) { + ctx.handleEx(ctxAssert); + } + pStmt->saveCtx(ctx); + ctx.logSqlExit(); + SQLRETURN ret = ctx.getCode(); + driver_exit(SQL_API_SQLNUMRESULTCOLS); + return ret; +} +#endif // ODBCVER >= 0x0000 diff --git a/storage/ndb/src/old_files/client/odbc/driver/SQLParamData.cpp b/storage/ndb/src/old_files/client/odbc/driver/SQLParamData.cpp new file mode 100644 index 00000000000..4eb38a010f4 --- /dev/null +++ b/storage/ndb/src/old_files/client/odbc/driver/SQLParamData.cpp @@ -0,0 +1,46 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "driver.hpp" + +#if ODBCVER >= 0x0000 +SQLRETURN SQL_API +SQLParamData( + SQLHSTMT StatementHandle, + SQLPOINTER* Value) +{ + driver_enter(SQL_API_SQLPARAMDATA); + const char* const sqlFunction = "SQLParamData"; + HandleRoot* const pRoot = HandleRoot::instance(); + HandleStmt* pStmt = pRoot->findStmt(StatementHandle); + if (pStmt == 0) { + driver_exit(SQL_API_SQLPARAMDATA); + return SQL_INVALID_HANDLE; + } + Ctx& ctx = *new Ctx; + ctx.logSqlEnter(sqlFunction); + try { + pStmt->sqlParamData(ctx, Value); + } catch (CtxAssert& ctxAssert) { + ctx.handleEx(ctxAssert); + } + pStmt->saveCtx(ctx); + ctx.logSqlExit(); + SQLRETURN ret = ctx.getCode(); + driver_exit(SQL_API_SQLPARAMDATA); + return ret; +} +#endif // ODBCVER >= 0x0000 diff --git a/storage/ndb/src/old_files/client/odbc/driver/SQLParamOptions.cpp b/storage/ndb/src/old_files/client/odbc/driver/SQLParamOptions.cpp new file mode 100644 index 00000000000..59b7dcf7fa9 --- /dev/null +++ b/storage/ndb/src/old_files/client/odbc/driver/SQLParamOptions.cpp @@ -0,0 +1,55 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "driver.hpp" + +#if ODBCVER >= 0x0000 +SQLRETURN SQL_API +SQLParamOptions( + SQLHSTMT hstmt, + SQLUINTEGER crow, + SQLUINTEGER* pirow) +{ +#ifndef auto_SQLParamOptions + const char* const sqlFunction = "SQLParamOptions"; + Ctx ctx; + ctx_log1(("*** not implemented: %s", sqlFunction)); + return SQL_ERROR; +#else + driver_enter(SQL_API_SQLPARAMOPTIONS); + const char* const sqlFunction = "SQLParamOptions"; + HandleRoot* const pRoot = HandleRoot::instance(); + HandleStmt* pStmt = pRoot->findStmt(hstmt); + if (pStmt == 0) { + driver_exit(SQL_API_SQLPARAMOPTIONS); + return SQL_INVALID_HANDLE; + } + Ctx& ctx = *new Ctx; + ctx.logSqlEnter(sqlFunction); + if (ctx.ok()) + pStmt->sqlParamOptions( + ctx, + crow, + &pirow + ); + pStmt->saveCtx(ctx); + ctx.logSqlExit(); + SQLRETURN ret = ctx.getCode(); + driver_exit(SQL_API_SQLPARAMOPTIONS); + return ret; +#endif +} +#endif // ODBCVER >= 0x0000 diff --git a/storage/ndb/src/old_files/client/odbc/driver/SQLPrepare.cpp b/storage/ndb/src/old_files/client/odbc/driver/SQLPrepare.cpp new file mode 100644 index 00000000000..b1205fa6e3a --- /dev/null +++ b/storage/ndb/src/old_files/client/odbc/driver/SQLPrepare.cpp @@ -0,0 +1,47 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "driver.hpp" + +#if ODBCVER >= 0x0000 +SQLRETURN SQL_API +SQLPrepare( + SQLHSTMT StatementHandle, + SQLCHAR* StatementText, + SQLINTEGER TextLength) +{ + driver_enter(SQL_API_SQLPREPARE); + const char* const sqlFunction = "SQLPrepare"; + HandleRoot* const pRoot = HandleRoot::instance(); + HandleStmt* pStmt = pRoot->findStmt(StatementHandle); + if (pStmt == 0) { + driver_exit(SQL_API_SQLPREPARE); + return SQL_INVALID_HANDLE; + } + Ctx& ctx = *new Ctx; + ctx.logSqlEnter(sqlFunction); + try { + pStmt->sqlPrepare(ctx, StatementText, TextLength); + } catch (CtxAssert& ctxAssert) { + ctx.handleEx(ctxAssert); + } + pStmt->saveCtx(ctx); + ctx.logSqlExit(); + SQLRETURN ret = ctx.getCode(); + driver_exit(SQL_API_SQLPREPARE); + return ret; +} +#endif // ODBCVER >= 0x0000 diff --git a/storage/ndb/src/old_files/client/odbc/driver/SQLPrimaryKeys.cpp b/storage/ndb/src/old_files/client/odbc/driver/SQLPrimaryKeys.cpp new file mode 100644 index 00000000000..2d562ae3e19 --- /dev/null +++ b/storage/ndb/src/old_files/client/odbc/driver/SQLPrimaryKeys.cpp @@ -0,0 +1,47 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "driver.hpp" + +#if ODBCVER >= 0x0000 +SQLRETURN SQL_API +SQLPrimaryKeys( + SQLHSTMT hstmt, + SQLCHAR* szCatalogName, + SQLSMALLINT cbCatalogName, + SQLCHAR* szSchemaName, + SQLSMALLINT cbSchemaName, + SQLCHAR* szTableName, + SQLSMALLINT cbTableName) +{ + driver_enter(SQL_API_SQLPRIMARYKEYS); + const char* const sqlFunction = "SQLPrimaryKeys"; + HandleRoot* const pRoot = HandleRoot::instance(); + HandleStmt* pStmt = pRoot->findStmt(hstmt); + if (pStmt == 0) { + driver_exit(SQL_API_SQLPRIMARYKEYS); + return SQL_INVALID_HANDLE; + } + Ctx& ctx = *new Ctx; + ctx.logSqlEnter(sqlFunction); + pStmt->sqlPrimaryKeys(ctx, szCatalogName, cbCatalogName, szSchemaName, cbSchemaName, szTableName, cbTableName); + pStmt->saveCtx(ctx); + ctx.logSqlExit(); + SQLRETURN ret = ctx.getCode(); + driver_exit(SQL_API_SQLPRIMARYKEYS); + return ret; +} +#endif // ODBCVER >= 0x0000 diff --git a/storage/ndb/src/old_files/client/odbc/driver/SQLProcedureColumns.cpp b/storage/ndb/src/old_files/client/odbc/driver/SQLProcedureColumns.cpp new file mode 100644 index 00000000000..2e42e428b87 --- /dev/null +++ b/storage/ndb/src/old_files/client/odbc/driver/SQLProcedureColumns.cpp @@ -0,0 +1,67 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "driver.hpp" + +#if ODBCVER >= 0x0000 +SQLRETURN SQL_API +SQLProcedureColumns( + SQLHSTMT hstmt, + SQLCHAR* szCatalogName, + SQLSMALLINT cbCatalogName, + SQLCHAR* szSchemaName, + SQLSMALLINT cbSchemaName, + SQLCHAR* szProcName, + SQLSMALLINT cbProcName, + SQLCHAR* szColumnName, + SQLSMALLINT cbColumnName) +{ +#ifndef auto_SQLProcedureColumns + const char* const sqlFunction = "SQLProcedureColumns"; + Ctx ctx; + ctx_log1(("*** not implemented: %s", sqlFunction)); + return SQL_ERROR; +#else + driver_enter(SQL_API_SQLPROCEDURECOLUMNS); + const char* const sqlFunction = "SQLProcedureColumns"; + HandleRoot* const pRoot = HandleRoot::instance(); + HandleStmt* pStmt = pRoot->findStmt(hstmt); + if (pStmt == 0) { + driver_exit(SQL_API_SQLPROCEDURECOLUMNS); + return SQL_INVALID_HANDLE; + } + Ctx& ctx = *new Ctx; + ctx.logSqlEnter(sqlFunction); + if (ctx.ok()) + pStmt->sqlProcedureColumns( + ctx, + &szCatalogName, + cbCatalogName, + &szSchemaName, + cbSchemaName, + &szProcName, + cbProcName, + &szColumnName, + cbColumnName + ); + pStmt->saveCtx(ctx); + ctx.logSqlExit(); + SQLRETURN ret = ctx.getCode(); + driver_exit(SQL_API_SQLPROCEDURECOLUMNS); + return ret; +#endif +} +#endif // ODBCVER >= 0x0000 diff --git a/storage/ndb/src/old_files/client/odbc/driver/SQLProcedures.cpp b/storage/ndb/src/old_files/client/odbc/driver/SQLProcedures.cpp new file mode 100644 index 00000000000..1f3a9f89073 --- /dev/null +++ b/storage/ndb/src/old_files/client/odbc/driver/SQLProcedures.cpp @@ -0,0 +1,63 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "driver.hpp" + +#if ODBCVER >= 0x0000 +SQLRETURN SQL_API +SQLProcedures( + SQLHSTMT hstmt, + SQLCHAR* szCatalogName, + SQLSMALLINT cbCatalogName, + SQLCHAR* szSchemaName, + SQLSMALLINT cbSchemaName, + SQLCHAR* szProcName, + SQLSMALLINT cbProcName) +{ +#ifndef auto_SQLProcedures + const char* const sqlFunction = "SQLProcedures"; + Ctx ctx; + ctx_log1(("*** not implemented: %s", sqlFunction)); + return SQL_ERROR; +#else + driver_enter(SQL_API_SQLPROCEDURES); + const char* const sqlFunction = "SQLProcedures"; + HandleRoot* const pRoot = HandleRoot::instance(); + HandleStmt* pStmt = pRoot->findStmt(hstmt); + if (pStmt == 0) { + driver_exit(SQL_API_SQLPROCEDURES); + return SQL_INVALID_HANDLE; + } + Ctx& ctx = *new Ctx; + ctx.logSqlEnter(sqlFunction); + if (ctx.ok()) + pStmt->sqlProcedures( + ctx, + &szCatalogName, + cbCatalogName, + &szSchemaName, + cbSchemaName, + &szProcName, + cbProcName + ); + pStmt->saveCtx(ctx); + ctx.logSqlExit(); + SQLRETURN ret = ctx.getCode(); + driver_exit(SQL_API_SQLPROCEDURES); + return ret; +#endif +} +#endif // ODBCVER >= 0x0000 diff --git a/storage/ndb/src/old_files/client/odbc/driver/SQLPutData.cpp b/storage/ndb/src/old_files/client/odbc/driver/SQLPutData.cpp new file mode 100644 index 00000000000..a4715a836d2 --- /dev/null +++ b/storage/ndb/src/old_files/client/odbc/driver/SQLPutData.cpp @@ -0,0 +1,47 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "driver.hpp" + +#if ODBCVER >= 0x0000 +SQLRETURN SQL_API +SQLPutData( + SQLHSTMT StatementHandle, + SQLPOINTER Data, + SQLINTEGER StrLen_or_Ind) +{ + driver_enter(SQL_API_SQLPUTDATA); + const char* const sqlFunction = "SQLPutData"; + HandleRoot* const pRoot = HandleRoot::instance(); + HandleStmt* pStmt = pRoot->findStmt(StatementHandle); + if (pStmt == 0) { + driver_exit(SQL_API_SQLPUTDATA); + return SQL_INVALID_HANDLE; + } + Ctx& ctx = *new Ctx; + ctx.logSqlEnter(sqlFunction); + try { + pStmt->sqlPutData(ctx, Data, StrLen_or_Ind); + } catch (CtxAssert& ctxAssert) { + ctx.handleEx(ctxAssert); + } + pStmt->saveCtx(ctx); + ctx.logSqlExit(); + SQLRETURN ret = ctx.getCode(); + driver_exit(SQL_API_SQLPUTDATA); + return ret; +} +#endif // ODBCVER >= 0x0000 diff --git a/storage/ndb/src/old_files/client/odbc/driver/SQLRowCount.cpp b/storage/ndb/src/old_files/client/odbc/driver/SQLRowCount.cpp new file mode 100644 index 00000000000..d03f954386a --- /dev/null +++ b/storage/ndb/src/old_files/client/odbc/driver/SQLRowCount.cpp @@ -0,0 +1,46 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "driver.hpp" + +#if ODBCVER >= 0x0000 +SQLRETURN SQL_API +SQLRowCount( + SQLHSTMT StatementHandle, + SQLINTEGER* RowCount) +{ + driver_enter(SQL_API_SQLROWCOUNT); + const char* const sqlFunction = "SQLRowCount"; + HandleRoot* const pRoot = HandleRoot::instance(); + HandleStmt* pStmt = pRoot->findStmt(StatementHandle); + if (pStmt == 0) { + driver_exit(SQL_API_SQLROWCOUNT); + return SQL_INVALID_HANDLE; + } + Ctx& ctx = *new Ctx; + ctx.logSqlEnter(sqlFunction); + try { + pStmt->sqlRowCount(ctx, RowCount); + } catch (CtxAssert& ctxAssert) { + ctx.handleEx(ctxAssert); + } + pStmt->saveCtx(ctx); + ctx.logSqlExit(); + SQLRETURN ret = ctx.getCode(); + driver_exit(SQL_API_SQLROWCOUNT); + return ret; +} +#endif // ODBCVER >= 0x0000 diff --git a/storage/ndb/src/old_files/client/odbc/driver/SQLSetConnectAttr.cpp b/storage/ndb/src/old_files/client/odbc/driver/SQLSetConnectAttr.cpp new file mode 100644 index 00000000000..05bfce5e9cd --- /dev/null +++ b/storage/ndb/src/old_files/client/odbc/driver/SQLSetConnectAttr.cpp @@ -0,0 +1,48 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "driver.hpp" + +#if ODBCVER >= 0x0300 +SQLRETURN SQL_API +SQLSetConnectAttr( + SQLHDBC ConnectionHandle, + SQLINTEGER Attribute, + SQLPOINTER Value, + SQLINTEGER StringLength) +{ + driver_enter(SQL_API_SQLSETCONNECTATTR); + const char* const sqlFunction = "SQLSetConnectAttr"; + HandleRoot* const pRoot = HandleRoot::instance(); + HandleDbc* pDbc = pRoot->findDbc(ConnectionHandle); + if (pDbc == 0) { + driver_exit(SQL_API_SQLSETCONNECTATTR); + return SQL_INVALID_HANDLE; + } + Ctx& ctx = *new Ctx; + ctx.logSqlEnter(sqlFunction); + try { + pDbc->sqlSetConnectAttr(ctx, Attribute, Value, StringLength); + } catch (CtxAssert& ctxAssert) { + ctx.handleEx(ctxAssert); + } + pDbc->saveCtx(ctx); + ctx.logSqlExit(); + SQLRETURN ret = ctx.getCode(); + driver_exit(SQL_API_SQLSETCONNECTATTR); + return ret; +} +#endif // ODBCVER >= 0x0300 diff --git a/storage/ndb/src/old_files/client/odbc/driver/SQLSetConnectOption.cpp b/storage/ndb/src/old_files/client/odbc/driver/SQLSetConnectOption.cpp new file mode 100644 index 00000000000..a4794316971 --- /dev/null +++ b/storage/ndb/src/old_files/client/odbc/driver/SQLSetConnectOption.cpp @@ -0,0 +1,47 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "driver.hpp" + +#if ODBCVER >= 0x0000 +SQLRETURN SQL_API +SQLSetConnectOption( + SQLHDBC ConnectionHandle, + SQLUSMALLINT Option, + SQLUINTEGER Value) +{ + driver_enter(SQL_API_SQLSETCONNECTOPTION); + const char* const sqlFunction = "SQLSetConnectOption"; + HandleRoot* const pRoot = HandleRoot::instance(); + HandleDbc* pDbc = pRoot->findDbc(ConnectionHandle); + if (pDbc == 0) { + driver_exit(SQL_API_SQLSETCONNECTOPTION); + return SQL_INVALID_HANDLE; + } + Ctx& ctx = *new Ctx; + ctx.logSqlEnter(sqlFunction); + try { + pDbc->sqlSetConnectOption(ctx, Option, Value); + } catch (CtxAssert& ctxAssert) { + ctx.handleEx(ctxAssert); + } + pDbc->saveCtx(ctx); + ctx.logSqlExit(); + SQLRETURN ret = ctx.getCode(); + driver_exit(SQL_API_SQLSETCONNECTOPTION); + return ret; +} +#endif // ODBCVER >= 0x0000 diff --git a/storage/ndb/src/old_files/client/odbc/driver/SQLSetCursorName.cpp b/storage/ndb/src/old_files/client/odbc/driver/SQLSetCursorName.cpp new file mode 100644 index 00000000000..291ad817d42 --- /dev/null +++ b/storage/ndb/src/old_files/client/odbc/driver/SQLSetCursorName.cpp @@ -0,0 +1,47 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "driver.hpp" + +#if ODBCVER >= 0x0000 +SQLRETURN SQL_API +SQLSetCursorName( + SQLHSTMT StatementHandle, + SQLCHAR* CursorName, + SQLSMALLINT NameLength) +{ + driver_enter(SQL_API_SQLSETCURSORNAME); + const char* const sqlFunction = "SQLSetCursorName"; + HandleRoot* const pRoot = HandleRoot::instance(); + HandleStmt* pStmt = pRoot->findStmt(StatementHandle); + if (pStmt == 0) { + driver_exit(SQL_API_SQLSETCURSORNAME); + return SQL_INVALID_HANDLE; + } + Ctx& ctx = *new Ctx; + ctx.logSqlEnter(sqlFunction); + try { + pStmt->sqlSetCursorName(ctx, CursorName, NameLength); + } catch (CtxAssert& ctxAssert) { + ctx.handleEx(ctxAssert); + } + pStmt->saveCtx(ctx); + ctx.logSqlExit(); + SQLRETURN ret = ctx.getCode(); + driver_exit(SQL_API_SQLSETCURSORNAME); + return ret; +} +#endif // ODBCVER >= 0x0000 diff --git a/storage/ndb/src/old_files/client/odbc/driver/SQLSetDescField.cpp b/storage/ndb/src/old_files/client/odbc/driver/SQLSetDescField.cpp new file mode 100644 index 00000000000..19d34c2f46d --- /dev/null +++ b/storage/ndb/src/old_files/client/odbc/driver/SQLSetDescField.cpp @@ -0,0 +1,49 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "driver.hpp" + +#if ODBCVER >= 0x0300 +SQLRETURN SQL_API +SQLSetDescField( + SQLHDESC DescriptorHandle, + SQLSMALLINT RecNumber, + SQLSMALLINT FieldIdentifier, + SQLPOINTER Value, + SQLINTEGER BufferLength) +{ + driver_enter(SQL_API_SQLSETDESCFIELD); + const char* const sqlFunction = "SQLSetDescField"; + HandleRoot* const pRoot = HandleRoot::instance(); + HandleDesc* pDesc = pRoot->findDesc(DescriptorHandle); + if (pDesc == 0) { + driver_exit(SQL_API_SQLSETDESCFIELD); + return SQL_INVALID_HANDLE; + } + Ctx& ctx = *new Ctx; + ctx.logSqlEnter(sqlFunction); + try { + pDesc->sqlSetDescField(ctx, RecNumber, FieldIdentifier, Value, BufferLength); + } catch (CtxAssert& ctxAssert) { + ctx.handleEx(ctxAssert); + } + pDesc->saveCtx(ctx); + ctx.logSqlExit(); + SQLRETURN ret = ctx.getCode(); + driver_exit(SQL_API_SQLSETDESCFIELD); + return ret; +} +#endif // ODBCVER >= 0x0300 diff --git a/storage/ndb/src/old_files/client/odbc/driver/SQLSetDescRec.cpp b/storage/ndb/src/old_files/client/odbc/driver/SQLSetDescRec.cpp new file mode 100644 index 00000000000..80a00514a51 --- /dev/null +++ b/storage/ndb/src/old_files/client/odbc/driver/SQLSetDescRec.cpp @@ -0,0 +1,54 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "driver.hpp" + +#if ODBCVER >= 0x0300 +SQLRETURN SQL_API +SQLSetDescRec( + SQLHDESC DescriptorHandle, + SQLSMALLINT RecNumber, + SQLSMALLINT Type, + SQLSMALLINT SubType, + SQLINTEGER Length, + SQLSMALLINT Precision, + SQLSMALLINT Scale, + SQLPOINTER Data, + SQLINTEGER* StringLength, + SQLINTEGER* Indicator) +{ + driver_enter(SQL_API_SQLSETDESCREC); + const char* const sqlFunction = "SQLSetDescRec"; + HandleRoot* const pRoot = HandleRoot::instance(); + HandleDesc* pDesc = pRoot->findDesc(DescriptorHandle); + if (pDesc == 0) { + driver_exit(SQL_API_SQLSETDESCREC); + return SQL_INVALID_HANDLE; + } + Ctx& ctx = *new Ctx; + ctx.logSqlEnter(sqlFunction); + try { + pDesc->sqlSetDescRec(ctx, RecNumber, Type, SubType, Length, Precision, Scale, Data, StringLength, Indicator); + } catch (CtxAssert& ctxAssert) { + ctx.handleEx(ctxAssert); + } + pDesc->saveCtx(ctx); + ctx.logSqlExit(); + SQLRETURN ret = ctx.getCode(); + driver_exit(SQL_API_SQLSETDESCREC); + return ret; +} +#endif // ODBCVER >= 0x0300 diff --git a/storage/ndb/src/old_files/client/odbc/driver/SQLSetEnvAttr.cpp b/storage/ndb/src/old_files/client/odbc/driver/SQLSetEnvAttr.cpp new file mode 100644 index 00000000000..86364eac5e8 --- /dev/null +++ b/storage/ndb/src/old_files/client/odbc/driver/SQLSetEnvAttr.cpp @@ -0,0 +1,65 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "driver.hpp" + +#if ODBCVER >= 0x0300 +SQLRETURN SQL_API +SQLSetEnvAttr( + SQLHENV EnvironmentHandle, + SQLINTEGER Attribute, + SQLPOINTER Value, + SQLINTEGER StringLength) +{ + driver_enter(SQL_API_SQLSETENVATTR); + const char* const sqlFunction = "SQLSetEnvAttr"; + HandleRoot* const pRoot = HandleRoot::instance(); + if (EnvironmentHandle == 0) { + // process-level attributes + Ctx& ctx = *new Ctx; + ctx.logSqlEnter(sqlFunction); + try { + pRoot->sqlSetRootAttr(ctx, Attribute, Value, StringLength); + } catch (CtxAssert& ctxAssert) { + ctx.handleEx(ctxAssert); + } + pRoot->saveCtx(ctx); + ctx.logSqlExit(); + SQLRETURN ret = ctx.getCode(); + driver_exit(SQL_API_SQLSETENVATTR); + return ret; + } else { + HandleEnv* pEnv = pRoot->findEnv(EnvironmentHandle); + if (pEnv == 0) { + driver_exit(SQL_API_SQLSETENVATTR); + return SQL_INVALID_HANDLE; + } + Ctx& ctx = *new Ctx; + ctx.logSqlEnter(sqlFunction); + try { + pEnv->sqlSetEnvAttr(ctx, Attribute, Value, StringLength); + } catch (CtxAssert& ctxAssert) { + ctx.handleEx(ctxAssert); + } + pEnv->saveCtx(ctx); + ctx.logSqlExit(); + SQLRETURN ret = ctx.getCode(); + driver_exit(SQL_API_SQLSETENVATTR); + return ret; + } + return SQL_ERROR; // not reached +} +#endif // ODBCVER >= 0x0300 diff --git a/storage/ndb/src/old_files/client/odbc/driver/SQLSetParam.cpp b/storage/ndb/src/old_files/client/odbc/driver/SQLSetParam.cpp new file mode 100644 index 00000000000..03bde1076d8 --- /dev/null +++ b/storage/ndb/src/old_files/client/odbc/driver/SQLSetParam.cpp @@ -0,0 +1,52 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "driver.hpp" + +#if ODBCVER >= 0x0000 +SQLRETURN SQL_API +SQLSetParam( + SQLHSTMT StatementHandle, + SQLUSMALLINT ParameterNumber, + SQLSMALLINT ValueType, + SQLSMALLINT ParameterType, + SQLUINTEGER LengthPrecision, + SQLSMALLINT ParameterScale, + SQLPOINTER ParameterValue, + SQLINTEGER* StrLen_or_Ind) +{ + driver_enter(SQL_API_SQLSETPARAM); + const char* const sqlFunction = "SQLSetParam"; + HandleRoot* const pRoot = HandleRoot::instance(); + HandleStmt* pStmt = pRoot->findStmt(StatementHandle); + if (pStmt == 0) { + driver_exit(SQL_API_SQLSETPARAM); + return SQL_INVALID_HANDLE; + } + Ctx& ctx = *new Ctx; + ctx.logSqlEnter(sqlFunction); + try { + pStmt->sqlSetParam(ctx, ParameterNumber, ValueType, ParameterType, LengthPrecision, ParameterScale, ParameterValue, StrLen_or_Ind); + } catch (CtxAssert& ctxAssert) { + ctx.handleEx(ctxAssert); + } + pStmt->saveCtx(ctx); + ctx.logSqlExit(); + SQLRETURN ret = ctx.getCode(); + driver_exit(SQL_API_SQLSETPARAM); + return ret; +} +#endif // ODBCVER >= 0x0000 diff --git a/storage/ndb/src/old_files/client/odbc/driver/SQLSetPos.cpp b/storage/ndb/src/old_files/client/odbc/driver/SQLSetPos.cpp new file mode 100644 index 00000000000..653030f90bc --- /dev/null +++ b/storage/ndb/src/old_files/client/odbc/driver/SQLSetPos.cpp @@ -0,0 +1,57 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "driver.hpp" + +#if ODBCVER >= 0x0000 +SQLRETURN SQL_API +SQLSetPos( + SQLHSTMT hstmt, + SQLUSMALLINT irow, + SQLUSMALLINT fOption, + SQLUSMALLINT fLock) +{ +#ifndef auto_SQLSetPos + const char* const sqlFunction = "SQLSetPos"; + Ctx ctx; + ctx_log1(("*** not implemented: %s", sqlFunction)); + return SQL_ERROR; +#else + driver_enter(SQL_API_SQLSETPOS); + const char* const sqlFunction = "SQLSetPos"; + HandleRoot* const pRoot = HandleRoot::instance(); + HandleStmt* pStmt = pRoot->findStmt(hstmt); + if (pStmt == 0) { + driver_exit(SQL_API_SQLSETPOS); + return SQL_INVALID_HANDLE; + } + Ctx& ctx = *new Ctx; + ctx.logSqlEnter(sqlFunction); + if (ctx.ok()) + pStmt->sqlSetPos( + ctx, + irow, + fOption, + fLock + ); + pStmt->saveCtx(ctx); + ctx.logSqlExit(); + SQLRETURN ret = ctx.getCode(); + driver_exit(SQL_API_SQLSETPOS); + return ret; +#endif +} +#endif // ODBCVER >= 0x0000 diff --git a/storage/ndb/src/old_files/client/odbc/driver/SQLSetScrollOptions.cpp b/storage/ndb/src/old_files/client/odbc/driver/SQLSetScrollOptions.cpp new file mode 100644 index 00000000000..a5e89d8568b --- /dev/null +++ b/storage/ndb/src/old_files/client/odbc/driver/SQLSetScrollOptions.cpp @@ -0,0 +1,57 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "driver.hpp" + +#if ODBCVER >= 0x0000 +SQLRETURN SQL_API +SQLSetScrollOptions( + SQLHSTMT hstmt, + SQLUSMALLINT fConcurrency, + SQLINTEGER crowKeyset, + SQLUSMALLINT crowRowset) +{ +#ifndef auto_SQLSetScrollOptions + const char* const sqlFunction = "SQLSetScrollOptions"; + Ctx ctx; + ctx_log1(("*** not implemented: %s", sqlFunction)); + return SQL_ERROR; +#else + driver_enter(SQL_API_SQLSETSCROLLOPTIONS); + const char* const sqlFunction = "SQLSetScrollOptions"; + HandleRoot* const pRoot = HandleRoot::instance(); + HandleStmt* pStmt = pRoot->findStmt(hstmt); + if (pStmt == 0) { + driver_exit(SQL_API_SQLSETSCROLLOPTIONS); + return SQL_INVALID_HANDLE; + } + Ctx& ctx = *new Ctx; + ctx.logSqlEnter(sqlFunction); + if (ctx.ok()) + pStmt->sqlSetScrollOptions( + ctx, + fConcurrency, + crowKeyset, + crowRowset + ); + pStmt->saveCtx(ctx); + ctx.logSqlExit(); + SQLRETURN ret = ctx.getCode(); + driver_exit(SQL_API_SQLSETSCROLLOPTIONS); + return ret; +#endif +} +#endif // ODBCVER >= 0x0000 diff --git a/storage/ndb/src/old_files/client/odbc/driver/SQLSetStmtAttr.cpp b/storage/ndb/src/old_files/client/odbc/driver/SQLSetStmtAttr.cpp new file mode 100644 index 00000000000..9ed6a83b563 --- /dev/null +++ b/storage/ndb/src/old_files/client/odbc/driver/SQLSetStmtAttr.cpp @@ -0,0 +1,48 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "driver.hpp" + +#if ODBCVER >= 0x0300 +SQLRETURN SQL_API +SQLSetStmtAttr( + SQLHSTMT StatementHandle, + SQLINTEGER Attribute, + SQLPOINTER Value, + SQLINTEGER StringLength) +{ + driver_enter(SQL_API_SQLSETSTMTATTR); + const char* const sqlFunction = "SQLSetStmtAttr"; + HandleRoot* const pRoot = HandleRoot::instance(); + HandleStmt* pStmt = pRoot->findStmt(StatementHandle); + if (pStmt == 0) { + driver_exit(SQL_API_SQLSETSTMTATTR); + return SQL_INVALID_HANDLE; + } + Ctx& ctx = *new Ctx; + ctx.logSqlEnter(sqlFunction); + try { + pStmt->sqlSetStmtAttr(ctx, Attribute, Value, StringLength); + } catch (CtxAssert& ctxAssert) { + ctx.handleEx(ctxAssert); + } + pStmt->saveCtx(ctx); + ctx.logSqlExit(); + SQLRETURN ret = ctx.getCode(); + driver_exit(SQL_API_SQLSETSTMTATTR); + return ret; +} +#endif // ODBCVER >= 0x0300 diff --git a/storage/ndb/src/old_files/client/odbc/driver/SQLSetStmtOption.cpp b/storage/ndb/src/old_files/client/odbc/driver/SQLSetStmtOption.cpp new file mode 100644 index 00000000000..b403fc8408c --- /dev/null +++ b/storage/ndb/src/old_files/client/odbc/driver/SQLSetStmtOption.cpp @@ -0,0 +1,47 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "driver.hpp" + +#if ODBCVER >= 0x0000 +SQLRETURN SQL_API +SQLSetStmtOption( + SQLHSTMT StatementHandle, + SQLUSMALLINT Option, + SQLUINTEGER Value) +{ + driver_enter(SQL_API_SQLSETSTMTOPTION); + const char* const sqlFunction = "SQLSetStmtOption"; + HandleRoot* const pRoot = HandleRoot::instance(); + HandleStmt* pStmt = pRoot->findStmt(StatementHandle); + if (pStmt == 0) { + driver_exit(SQL_API_SQLSETSTMTOPTION); + return SQL_INVALID_HANDLE; + } + Ctx& ctx = *new Ctx; + ctx.logSqlEnter(sqlFunction); + try { + pStmt->sqlSetStmtOption(ctx, Option, Value); + } catch (CtxAssert& ctxAssert) { + ctx.handleEx(ctxAssert); + } + pStmt->saveCtx(ctx); + ctx.logSqlExit(); + SQLRETURN ret = ctx.getCode(); + driver_exit(SQL_API_SQLSETSTMTOPTION); + return ret; +} +#endif // ODBCVER >= 0x0000 diff --git a/storage/ndb/src/old_files/client/odbc/driver/SQLSpecialColumns.cpp b/storage/ndb/src/old_files/client/odbc/driver/SQLSpecialColumns.cpp new file mode 100644 index 00000000000..5dd92c86053 --- /dev/null +++ b/storage/ndb/src/old_files/client/odbc/driver/SQLSpecialColumns.cpp @@ -0,0 +1,69 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "driver.hpp" + +#if ODBCVER >= 0x0000 +SQLRETURN SQL_API +SQLSpecialColumns( + SQLHSTMT StatementHandle, + SQLUSMALLINT IdentifierType, + SQLCHAR* CatalogName, + SQLSMALLINT NameLength1, + SQLCHAR* SchemaName, + SQLSMALLINT NameLength2, + SQLCHAR* TableName, + SQLSMALLINT NameLength3, + SQLUSMALLINT Scope, + SQLUSMALLINT Nullable) +{ +#ifndef auto_SQLSpecialColumns + const char* const sqlFunction = "SQLSpecialColumns"; + Ctx ctx; + ctx_log1(("*** not implemented: %s", sqlFunction)); + return SQL_ERROR; +#else + driver_enter(SQL_API_SQLSPECIALCOLUMNS); + const char* const sqlFunction = "SQLSpecialColumns"; + HandleRoot* const pRoot = HandleRoot::instance(); + HandleStmt* pStmt = pRoot->findStmt(StatementHandle); + if (pStmt == 0) { + driver_exit(SQL_API_SQLSPECIALCOLUMNS); + return SQL_INVALID_HANDLE; + } + Ctx& ctx = *new Ctx; + ctx.logSqlEnter(sqlFunction); + if (ctx.ok()) + pStmt->sqlSpecialColumns( + ctx, + IdentifierType, + &CatalogName, + NameLength1, + &SchemaName, + NameLength2, + &TableName, + NameLength3, + Scope, + Nullable + ); + pStmt->saveCtx(ctx); + ctx.logSqlExit(); + SQLRETURN ret = ctx.getCode(); + driver_exit(SQL_API_SQLSPECIALCOLUMNS); + return ret; +#endif +} +#endif // ODBCVER >= 0x0000 diff --git a/storage/ndb/src/old_files/client/odbc/driver/SQLStatistics.cpp b/storage/ndb/src/old_files/client/odbc/driver/SQLStatistics.cpp new file mode 100644 index 00000000000..941fb6249a5 --- /dev/null +++ b/storage/ndb/src/old_files/client/odbc/driver/SQLStatistics.cpp @@ -0,0 +1,67 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "driver.hpp" + +#if ODBCVER >= 0x0000 +SQLRETURN SQL_API +SQLStatistics( + SQLHSTMT StatementHandle, + SQLCHAR* CatalogName, + SQLSMALLINT NameLength1, + SQLCHAR* SchemaName, + SQLSMALLINT NameLength2, + SQLCHAR* TableName, + SQLSMALLINT NameLength3, + SQLUSMALLINT Unique, + SQLUSMALLINT Reserved) +{ +#ifndef auto_SQLStatistics + const char* const sqlFunction = "SQLStatistics"; + Ctx ctx; + ctx_log1(("*** not implemented: %s", sqlFunction)); + return SQL_ERROR; +#else + driver_enter(SQL_API_SQLSTATISTICS); + const char* const sqlFunction = "SQLStatistics"; + HandleRoot* const pRoot = HandleRoot::instance(); + HandleStmt* pStmt = pRoot->findStmt(StatementHandle); + if (pStmt == 0) { + driver_exit(SQL_API_SQLSTATISTICS); + return SQL_INVALID_HANDLE; + } + Ctx& ctx = *new Ctx; + ctx.logSqlEnter(sqlFunction); + if (ctx.ok()) + pStmt->sqlStatistics( + ctx, + &CatalogName, + NameLength1, + &SchemaName, + NameLength2, + &TableName, + NameLength3, + Unique, + Reserved + ); + pStmt->saveCtx(ctx); + ctx.logSqlExit(); + SQLRETURN ret = ctx.getCode(); + driver_exit(SQL_API_SQLSTATISTICS); + return ret; +#endif +} +#endif // ODBCVER >= 0x0000 diff --git a/storage/ndb/src/old_files/client/odbc/driver/SQLTablePrivileges.cpp b/storage/ndb/src/old_files/client/odbc/driver/SQLTablePrivileges.cpp new file mode 100644 index 00000000000..23c6ad9fc4b --- /dev/null +++ b/storage/ndb/src/old_files/client/odbc/driver/SQLTablePrivileges.cpp @@ -0,0 +1,63 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "driver.hpp" + +#if ODBCVER >= 0x0000 +SQLRETURN SQL_API +SQLTablePrivileges( + SQLHSTMT hstmt, + SQLCHAR* szCatalogName, + SQLSMALLINT cbCatalogName, + SQLCHAR* szSchemaName, + SQLSMALLINT cbSchemaName, + SQLCHAR* szTableName, + SQLSMALLINT cbTableName) +{ +#ifndef auto_SQLTablePrivileges + const char* const sqlFunction = "SQLTablePrivileges"; + Ctx ctx; + ctx_log1(("*** not implemented: %s", sqlFunction)); + return SQL_ERROR; +#else + driver_enter(SQL_API_SQLTABLEPRIVILEGES); + const char* const sqlFunction = "SQLTablePrivileges"; + HandleRoot* const pRoot = HandleRoot::instance(); + HandleStmt* pStmt = pRoot->findStmt(hstmt); + if (pStmt == 0) { + driver_exit(SQL_API_SQLTABLEPRIVILEGES); + return SQL_INVALID_HANDLE; + } + Ctx& ctx = *new Ctx; + ctx.logSqlEnter(sqlFunction); + if (ctx.ok()) + pStmt->sqlTablePrivileges( + ctx, + &szCatalogName, + cbCatalogName, + &szSchemaName, + cbSchemaName, + &szTableName, + cbTableName + ); + pStmt->saveCtx(ctx); + ctx.logSqlExit(); + SQLRETURN ret = ctx.getCode(); + driver_exit(SQL_API_SQLTABLEPRIVILEGES); + return ret; +#endif +} +#endif // ODBCVER >= 0x0000 diff --git a/storage/ndb/src/old_files/client/odbc/driver/SQLTables.cpp b/storage/ndb/src/old_files/client/odbc/driver/SQLTables.cpp new file mode 100644 index 00000000000..b2496bfba87 --- /dev/null +++ b/storage/ndb/src/old_files/client/odbc/driver/SQLTables.cpp @@ -0,0 +1,49 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "driver.hpp" + +#if ODBCVER >= 0x0000 +SQLRETURN SQL_API +SQLTables( + SQLHSTMT StatementHandle, + SQLCHAR* CatalogName, + SQLSMALLINT NameLength1, + SQLCHAR* SchemaName, + SQLSMALLINT NameLength2, + SQLCHAR* TableName, + SQLSMALLINT NameLength3, + SQLCHAR* TableType, + SQLSMALLINT NameLength4) +{ + driver_enter(SQL_API_SQLTABLES); + const char* const sqlFunction = "SQLTables"; + HandleRoot* const pRoot = HandleRoot::instance(); + HandleStmt* pStmt = pRoot->findStmt(StatementHandle); + if (pStmt == 0) { + driver_exit(SQL_API_SQLTABLES); + return SQL_INVALID_HANDLE; + } + Ctx& ctx = *new Ctx; + ctx.logSqlEnter(sqlFunction); + pStmt->sqlTables(ctx, CatalogName, NameLength1, SchemaName, NameLength2, TableName, NameLength3, TableType, NameLength4); + pStmt->saveCtx(ctx); + ctx.logSqlExit(); + SQLRETURN ret = ctx.getCode(); + driver_exit(SQL_API_SQLTABLES); + return ret; +} +#endif // ODBCVER >= 0x0000 diff --git a/storage/ndb/src/old_files/client/odbc/driver/SQLTransact.cpp b/storage/ndb/src/old_files/client/odbc/driver/SQLTransact.cpp new file mode 100644 index 00000000000..da8b46b1596 --- /dev/null +++ b/storage/ndb/src/old_files/client/odbc/driver/SQLTransact.cpp @@ -0,0 +1,71 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "driver.hpp" + +#if ODBCVER >= 0x0000 +SQLRETURN SQL_API +SQLTransact( + SQLHENV EnvironmentHandle, + SQLHDBC ConnectionHandle, + SQLUSMALLINT CompletionType) +{ + driver_enter(SQL_API_SQLTRANSACT); + const char* const sqlFunction = "SQLTransact"; + HandleRoot* const pRoot = HandleRoot::instance(); + // check connection first and ignore environment + if (ConnectionHandle != SQL_NULL_HANDLE) { + HandleDbc* pDbc = pRoot->findDbc(ConnectionHandle); + if (pDbc == 0) { + driver_exit(SQL_API_SQLTRANSACT); + return SQL_INVALID_HANDLE; + } + Ctx& ctx = *new Ctx; + ctx.logSqlEnter(sqlFunction); + try { + pDbc->sqlTransact(ctx, CompletionType); + } catch (CtxAssert& ctxAssert) { + ctx.handleEx(ctxAssert); + } + pDbc->saveCtx(ctx); + ctx.logSqlExit(); + SQLRETURN ret = ctx.getCode(); + driver_exit(SQL_API_SQLTRANSACT); + return ret; + } + if (EnvironmentHandle != SQL_NULL_HANDLE) { + HandleEnv* pEnv = pRoot->findEnv(EnvironmentHandle); + if (pEnv == 0) { + driver_exit(SQL_API_SQLTRANSACT); + return SQL_INVALID_HANDLE; + } + Ctx& ctx = *new Ctx; + ctx.logSqlEnter(sqlFunction); + try { + pEnv->sqlTransact(ctx, CompletionType); + } catch (CtxAssert& ctxAssert) { + ctx.handleEx(ctxAssert); + } + pEnv->saveCtx(ctx); + ctx.logSqlExit(); + SQLRETURN ret = ctx.getCode(); + driver_exit(SQL_API_SQLTRANSACT); + return ret; + } + driver_exit(SQL_API_SQLTRANSACT); + return SQL_INVALID_HANDLE; +} +#endif // ODBCVER >= 0x0000 diff --git a/storage/ndb/src/old_files/client/odbc/driver/driver.cpp b/storage/ndb/src/old_files/client/odbc/driver/driver.cpp new file mode 100644 index 00000000000..f992fa70878 --- /dev/null +++ b/storage/ndb/src/old_files/client/odbc/driver/driver.cpp @@ -0,0 +1,150 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "driver.hpp" +#include <NdbMutex.h> + +#undef NDB_ODBC_SIG_DFL +#ifdef NDB_ODBC_SIG_DFL +#include <signal.h> +#endif + +// The big mutex (just in case). + +#ifdef NDB_WIN32 +static NdbMutex & driver_mutex = * NdbMutex_Create(); +#else +static NdbMutex driver_mutex = NDB_MUTEX_INITIALIZER; +#endif + +static void +driver_lock() +{ + NdbMutex_Lock(&driver_mutex); +} + +static void +driver_unlock() +{ + NdbMutex_Unlock(&driver_mutex); +} + +// Hooks for function entry and exit. + +static inline void +driver_enter(SQLUSMALLINT functionId) +{ + switch (functionId) { + default: + break; + } +#ifdef NDB_ODBC_SIG_DFL + // XXX need to restore old sig + for (int i = 1; i <= 30; i++) + signal(i, SIG_DFL); +#endif +} + +static inline void +driver_exit(SQLUSMALLINT functionId) +{ + switch (functionId) { + default: + break; + } +} + +// Some C++ compilers (like gcc) cannot merge template code +// in different files. So compile all in one file. + +#include "SQLAllocConnect.cpp" +#include "SQLAllocEnv.cpp" +#include "SQLAllocHandle.cpp" +#include "SQLAllocHandleStd.cpp" +#include "SQLAllocStmt.cpp" +#include "SQLBindCol.cpp" +#include "SQLBindParam.cpp" +#include "SQLBindParameter.cpp" +#include "SQLBrowseConnect.cpp" +#include "SQLBulkOperations.cpp" +#include "SQLCancel.cpp" +#include "SQLCloseCursor.cpp" +#include "SQLColAttribute.cpp" +#include "SQLColAttributes.cpp" +#include "SQLColumnPrivileges.cpp" +#include "SQLColumns.cpp" +#include "SQLConnect.cpp" +#include "SQLCopyDesc.cpp" +#include "SQLDataSources.cpp" +#include "SQLDescribeCol.cpp" +#include "SQLDescribeParam.cpp" +#include "SQLDisconnect.cpp" +#include "SQLDriverConnect.cpp" +#include "SQLDrivers.cpp" +#include "SQLEndTran.cpp" +#include "SQLError.cpp" +#include "SQLExecDirect.cpp" +#include "SQLExecute.cpp" +#include "SQLExtendedFetch.cpp" +#include "SQLFetch.cpp" +#include "SQLFetchScroll.cpp" +#include "SQLForeignKeys.cpp" +#include "SQLFreeConnect.cpp" +#include "SQLFreeEnv.cpp" +#include "SQLFreeHandle.cpp" +#include "SQLFreeStmt.cpp" +#include "SQLGetConnectAttr.cpp" +#include "SQLGetConnectOption.cpp" +#include "SQLGetCursorName.cpp" +#include "SQLGetData.cpp" +#include "SQLGetDescField.cpp" +#include "SQLGetDescRec.cpp" +#include "SQLGetDiagField.cpp" +#include "SQLGetDiagRec.cpp" +#include "SQLGetEnvAttr.cpp" +#include "SQLGetFunctions.cpp" +#include "SQLGetInfo.cpp" +#include "SQLGetStmtAttr.cpp" +#include "SQLGetStmtOption.cpp" +#include "SQLGetTypeInfo.cpp" +#include "SQLMoreResults.cpp" +#include "SQLNativeSql.cpp" +#include "SQLNumParams.cpp" +#include "SQLNumResultCols.cpp" +#include "SQLParamData.cpp" +#include "SQLParamOptions.cpp" +#include "SQLPrepare.cpp" +#include "SQLPrimaryKeys.cpp" +#include "SQLProcedureColumns.cpp" +#include "SQLProcedures.cpp" +#include "SQLPutData.cpp" +#include "SQLRowCount.cpp" +#include "SQLSetConnectAttr.cpp" +#include "SQLSetConnectOption.cpp" +#include "SQLSetCursorName.cpp" +#include "SQLSetDescField.cpp" +#include "SQLSetDescRec.cpp" +#include "SQLSetEnvAttr.cpp" +#include "SQLSetParam.cpp" +#include "SQLSetPos.cpp" +#include "SQLSetScrollOptions.cpp" +#include "SQLSetStmtAttr.cpp" +#include "SQLSetStmtOption.cpp" +#include "SQLSpecialColumns.cpp" +#include "SQLStatistics.cpp" +#include "SQLTablePrivileges.cpp" +#include "SQLTables.cpp" +#include "SQLTransact.cpp" diff --git a/storage/ndb/src/old_files/client/odbc/driver/driver.hpp b/storage/ndb/src/old_files/client/odbc/driver/driver.hpp new file mode 100644 index 00000000000..96d2e052c0d --- /dev/null +++ b/storage/ndb/src/old_files/client/odbc/driver/driver.hpp @@ -0,0 +1,28 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef ODBC_DRIVER_driver_hpp +#define ODBC_DRIVER_driver_hpp + +#include <common/common.hpp> +#include <common/OdbcData.hpp> +#include <handles/handles.hpp> + +#ifndef NDB_WIN32 +#define SQL_API +#endif + +#endif |