comparison Framework/MySQL/MySQLResult.cpp @ 240:c82c2cf84ae8

added handling of CR_COMMANDS_OUT_OF_SYNC
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 12 Apr 2021 17:07:06 +0200
parents 3236894320d6
children 16aac0287485
comparison
equal deleted inserted replaced
239:e9ba888f371b 240:c82c2cf84ae8
41 { 41 {
42 // This case occurs in requests without a result (e.g. if the 42 // This case occurs in requests without a result (e.g. if the
43 // SQL request is not a SELECT) 43 // SQL request is not a SELECT)
44 done_ = true; 44 done_ = true;
45 } 45 }
46 else if (error == CR_SERVER_GONE_ERROR ||
47 error == CR_SERVER_LOST ||
48 error == ER_QUERY_INTERRUPTED)
49 {
50 database_.LogError();
51 throw Orthanc::OrthancException(Orthanc::ErrorCode_DatabaseUnavailable);
52 }
53 else 46 else
54 { 47 {
55 database_.LogError(); 48 database_.ThrowException();
56 throw Orthanc::OrthancException(Orthanc::ErrorCode_Database);
57 } 49 }
58 } 50 }
59 else 51 else
60 { 52 {
61 done_ = (code != 0 && 53 done_ = (code != 0 &&
80 // !!! https://dev.mysql.com/doc/refman/5.7/en/mysql-stmt-fetch.html 72 // !!! https://dev.mysql.com/doc/refman/5.7/en/mysql-stmt-fetch.html
81 // https://gist.github.com/hoterran/6365915 73 // https://gist.github.com/hoterran/6365915
82 // https://github.com/hholzgra/connector-c-examples/blob/master/mysql_stmt_bind_result.c 74 // https://github.com/hholzgra/connector-c-examples/blob/master/mysql_stmt_bind_result.c
83 75
84 SetFieldsCount(statement_.GetResultFieldsCount()); 76 SetFieldsCount(statement_.GetResultFieldsCount());
85 77
86 Step(); 78 Step();
87 } 79 }
88 80
89 81
90 MySQLResult::~MySQLResult() 82 MySQLResult::~MySQLResult()