aboutsummaryrefslogtreecommitdiffstats
path: root/lib/odbc/c_src/odbcserver.c
diff options
context:
space:
mode:
authorIngela Anderton Andin <[email protected]>2011-06-16 11:26:41 +0200
committerIngela Anderton Andin <[email protected]>2011-06-16 11:26:41 +0200
commit85d69b7881d8a213d723c675ea314689c43cbb8d (patch)
treebe4c659d336958a52d72ae89e2e8501fd0dc22cc /lib/odbc/c_src/odbcserver.c
parentb60c05ff97b76082969f969dc8b19b61649d259b (diff)
parenta70ee114820dd3922f3049e93981bc326af1863a (diff)
downloadotp-85d69b7881d8a213d723c675ea314689c43cbb8d.tar.gz
otp-85d69b7881d8a213d723c675ea314689c43cbb8d.tar.bz2
otp-85d69b7881d8a213d723c675ea314689c43cbb8d.zip
Merge branch 'ia/odbc/mysql' into dev
* ia/odbc/mysql: Test odbc with MySQL
Diffstat (limited to 'lib/odbc/c_src/odbcserver.c')
-rw-r--r--lib/odbc/c_src/odbcserver.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/odbc/c_src/odbcserver.c b/lib/odbc/c_src/odbcserver.c
index ad14ecd1dd..3dd7da08b9 100644
--- a/lib/odbc/c_src/odbcserver.c
+++ b/lib/odbc/c_src/odbcserver.c
@@ -1003,12 +1003,16 @@ static db_result_msg encode_result(db_state *state)
db_result_msg msg;
int elements, update, num_of_rows = 0;
char *atom;
+ diagnos diagnos;
msg = encode_empty_message();
if(!sql_success(SQLNumResultCols(statement_handle(state),
&num_of_columns))) {
- DO_EXIT(EXIT_COLS);
+ diagnos = get_diagnos(SQL_HANDLE_STMT, statement_handle(state));
+ msg = encode_error_message(diagnos.error_msg);
+ clean_state(state);
+ return msg;
}
if (num_of_columns == 0) {
@@ -1022,7 +1026,10 @@ static db_result_msg encode_result(db_state *state)
}
if(!sql_success(SQLRowCount(statement_handle(state), &RowCountPtr))) {
- DO_EXIT(EXIT_ROWS);
+ diagnos = get_diagnos(SQL_HANDLE_STMT, statement_handle(state));
+ msg = encode_error_message(diagnos.error_msg);
+ clean_state(state);
+ return msg;
}
if(param_query(state) && update) {