OCT 删除调试代码

This commit is contained in:
mengqingchao 2019-07-23 10:16:40 +08:00
parent 6fec2cfccb
commit 98c830fa69
1 changed files with 17 additions and 17 deletions

View File

@ -91,10 +91,9 @@ void * connect_database (int module_id)
SQLAllocHandle( SQL_HANDLE_DBC, henv, &hdbc ); SQLAllocHandle( SQL_HANDLE_DBC, henv, &hdbc );
SQLSetConnectAttr( hdbc, SQL_ATTR_ODBC_CURSORS, (SQLPOINTER)SQL_CUR_USE_ODBC, 0 ); SQLSetConnectAttr( hdbc, SQL_ATTR_ODBC_CURSORS, (SQLPOINTER)SQL_CUR_USE_ODBC, 0 );
ret = SQLConnect( hdbc, "meng", SQL_NTS, "", SQL_NTS, "", SQL_NTS ); ret = SQLConnect( hdbc, "meng", SQL_NTS, "", SQL_NTS, "", SQL_NTS );
if (ret != SQL_SUCCESS)
DumpODBCLog(NULL, hdbc, NULL);
if (ret != SQL_SUCCESS && ret != SQL_SUCCESS_WITH_INFO)
{ {
return NULL; return NULL;
} }
@ -121,12 +120,14 @@ void * connect_database (int module_id)
int disconnect_database (int module_id, void * db_handle) int disconnect_database (int module_id, void * db_handle)
{ {
SQLRETURN ret; SQLRETURN ret;
if (NULL == db_handle) if (NULL == db_handle)
{ {
return DB_RET_PARAM_NULL; return DB_RET_PARAM_NULL;
} }
SQLDisconnect(db_handle); SQLDisconnect(db_handle);
ret = SQLFreeHandle(SQL_HANDLE_DBC, db_handle); ret = SQLFreeHandle(SQL_HANDLE_DBC, db_handle);
if (ret != SQL_SUCCESS) if (ret != SQL_SUCCESS)
{ {
@ -213,7 +214,6 @@ int update_database(int module_id, void * db_handle, int op_type, char * tabl
return DB_RET_PARAM_NULL; return DB_RET_PARAM_NULL;
} }
if ((op_type != DB_OP_INSERT) && (op_type != DB_OP_DEL) && (op_type != DB_OP_UPDATE)) if ((op_type != DB_OP_INSERT) && (op_type != DB_OP_DEL) && (op_type != DB_OP_UPDATE))
{ {
return DB_RET_PARAM_ERR; return DB_RET_PARAM_ERR;
@ -272,7 +272,8 @@ int update_database(int module_id, void * db_handle, int op_type, char * tabl
} }
else else
{ {
printf("\n type error : %d", type); /* 当前只支持以上三种类型,如果不是则打印报错 */
printf("\n type error : %d", type);
} }
} }
@ -285,8 +286,7 @@ int update_database(int module_id, void * db_handle, int op_type, char * tabl
SQLFreeStmt(hstmt, SQL_DROP); SQLFreeStmt(hstmt, SQL_DROP);
if (ret != SQL_SUCCESS) if (ret != SQL_SUCCESS)
{ {
DumpODBCLog(NULL, db_handle, hstmt);
return DB_RET_ERR; return DB_RET_ERR;
} }
@ -346,7 +346,7 @@ void * select_datebase_by_number(int module_id, void * db_handle, char * table_
return NULL; return NULL;
} }
ret = SQLAllocHandle( SQL_HANDLE_STMT, db_handle, &hstmt); ret = SQLAllocHandle(SQL_HANDLE_STMT, db_handle, &hstmt);
if ((SQL_INVALID_HANDLE == ret) || (SQL_ERROR == ret)) if ((SQL_INVALID_HANDLE == ret) || (SQL_ERROR == ret))
{ {
return NULL; return NULL;
@ -429,7 +429,8 @@ void * select_datebase_by_number(int module_id, void * db_handle, char * table_
} }
else else
{ {
/* 当前只支持以上三种类型,如果不是则打印报错 */
printf("\n type error : %d", type);
} }
} }
@ -464,7 +465,7 @@ void * select_datebase_by_number(int module_id, void * db_handle, char * table_
} }
else else
{ {
/* 不支持的类型 */
} }
} }
@ -488,9 +489,6 @@ void * select_datebase_by_number(int module_id, void * db_handle, char * table_
for (j = 1; j <= column_nmuber; j++) for (j = 1; j <= column_nmuber; j++)
{ {
printf("\n db_column_info[j].dateType: %d j : %d", db_column_info[j].dateType, j);
if (SQL_BIGINT == db_column_info[j].dateType) if (SQL_BIGINT == db_column_info[j].dateType)
{ {
cJSON_AddNumberToObject(obj, db_column_info[j].name, *((long long *)&(value[j][0]))); cJSON_AddNumberToObject(obj, db_column_info[j].name, *((long long *)&(value[j][0])));
@ -545,13 +543,13 @@ void * select_datebase_by_number(int module_id, void * db_handle, char * table_
int free_database_memory(int module_id, char * table_name, void * memory_ptr) int free_database_memory(int module_id, char * table_name, void * memory_ptr)
{ {
if ((NULL == table_name) && (NULL == memory_ptr)) if ((NULL == table_name) && (NULL == memory_ptr))
{ {
return DB_RET_PARAM_NULL; return DB_RET_PARAM_NULL;
} }
free(memory_ptr); free(memory_ptr);
return DB_RET_OK; return DB_RET_OK;
} }
/********************************************************************************* /*********************************************************************************
  * Description     * Description  
@ -656,6 +654,8 @@ int get_select_datebase_number(int module_id, void * db_handle, char * table_n
} }
} }
va_end(ap);
ret = SQLExecute(hstmt); ret = SQLExecute(hstmt);
} }