diff options
author | Ingela Anderton Andin <[email protected]> | 2011-05-30 10:32:35 +0200 |
---|---|---|
committer | Ingela Anderton Andin <[email protected]> | 2011-06-13 11:11:33 +0200 |
commit | a70ee114820dd3922f3049e93981bc326af1863a (patch) | |
tree | dd90ed35ffdd4f748d6c882e66db021d48940d43 /lib/odbc/c_src | |
parent | 751ec4f918bed2f5455538e6296c6b925bcca002 (diff) | |
download | otp-a70ee114820dd3922f3049e93981bc326af1863a.tar.gz otp-a70ee114820dd3922f3049e93981bc326af1863a.tar.bz2 otp-a70ee114820dd3922f3049e93981bc326af1863a.zip |
Test odbc with MySQL
Updated test framework to also be able to test the erlang odbc application
with MySQL as database.
Made minor changes to error-handling to improve interoperability
with MySQL-drivers.
Diffstat (limited to 'lib/odbc/c_src')
-rw-r--r-- | lib/odbc/c_src/odbcserver.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/odbc/c_src/odbcserver.c b/lib/odbc/c_src/odbcserver.c index d61ce940c3..fb3c753450 100644 --- a/lib/odbc/c_src/odbcserver.c +++ b/lib/odbc/c_src/odbcserver.c @@ -1002,12 +1002,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) { @@ -1021,7 +1025,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) { |