From: Vlad K. <hv...@us...> - 2008-06-19 10:45:31
|
Build Version : T2.5.0.20417 Firebird 2.5 Alpha 1 (writeBuildNum.sh,v 1.20578 2008/06/19 10:45:31 hvlad Exp $ ) Update of /cvsroot/firebird/firebird2/src/jrd/extds In directory sc8-pr-cvs17.sourceforge.net:/tmp/cvs-serv5308/jrd/extds Modified Files: ExtDS.cpp Log Message: Error messages for EXECUTE STATEMENT Index: ExtDS.cpp =================================================================== RCS file: /cvsroot/firebird/firebird2/src/jrd/extds/ExtDS.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -b -U3 -r1.11 -r1.12 --- ExtDS.cpp 9 Jun 2008 01:34:28 -0000 1.11 +++ ExtDS.cpp 19 Jun 2008 10:45:18 -0000 1.12 @@ -88,9 +88,8 @@ } } - string err; - err.printf("External Data Source provider ''%s'' not found", prvName.c_str()); - ERR_post(isc_random, isc_arg_string, ERR_cstring(err), 0); + // External Data Source provider ''@1'' not found + ERR_post(isc_eds_provider_not_found, isc_arg_string, ERR_cstring(prvName), isc_arg_end); return NULL; } @@ -420,20 +419,15 @@ void Connection::raise(ISC_STATUS* status, thread_db *tdbb, const char* sWhere) { - // hvlad: TODO error message like - // "Execute statement error at %s :\n%sData source : %s" or - // "Execute statement error at @1 :\n@2Data source : @3" - - string err; - err.printf("Execute statement error at %s :\n", sWhere); - string rem_err; m_provider.getRemoteError(status, rem_err); - err += rem_err; - - err += "Data source : " + getDataSourceName(); - ERR_post(isc_random, isc_arg_string, ERR_cstring(err), 0); + // Execute statement error at @1 :\n@2Data source : @3 + ERR_post(isc_eds_connection, + isc_arg_string, sWhere, + isc_arg_string, ERR_cstring(rem_err), + isc_arg_string, ERR_cstring(getDataSourceName()), + isc_arg_end); } @@ -920,7 +914,9 @@ } if (p >= end || tok != ttIdent) { - ERR_post(isc_random, isc_arg_string, "Statement expected", isc_arg_end); + // Execute statement preprocess SQL error + // Statement expected + ERR_post(isc_eds_preprocess, isc_arg_gds, isc_eds_stmt_expected, isc_arg_end); } start = i; // skip leading comments ?? @@ -937,7 +933,9 @@ tok = getToken(&p, end); } if (p >= end || tok != ttIdent) { - ERR_post(isc_random, isc_arg_string, "Statement expected", isc_arg_end); + // Execute statement preprocess SQL error + // Statement expected + ERR_post(isc_eds_preprocess, isc_arg_gds, isc_eds_stmt_expected, isc_arg_end); } string ident2(i2, p - i2); ident2.upper(); @@ -988,7 +986,9 @@ m_sqlParamsMap.add(m_sqlParamNames[n]); } else { - ERR_post(isc_random, isc_arg_string, "Parameter name expected", 0); + // Execute statement preprocess SQL error + // Parameter name expected + ERR_post(isc_eds_preprocess, isc_arg_gds, isc_eds_prm_name_expected, isc_arg_end); } ret += '?'; break; @@ -1015,15 +1015,17 @@ case ttBrokenComment: { - Firebird::string s; - s = "Unclosed comment found near \"" + Firebird::string(start, MIN(16, end - start)) + "\""; - ERR_post(isc_random, isc_arg_string, ERR_string(s), isc_arg_end); + // Execute statement preprocess SQL error + // Unclosed comment found near ''@1'' + Firebird::string s(start, MIN(16, end - start)); + ERR_post(isc_eds_preprocess, isc_arg_gds, isc_eds_unclosed_comment, isc_arg_string, ERR_cstring(s), isc_arg_end); } break; case ttNone: - ERR_post(isc_random, isc_arg_string, "parse error", 0); + // Execute statement preprocess SQL error + ERR_post(isc_eds_preprocess, isc_arg_end); break; } } @@ -1287,17 +1289,10 @@ { m_error = true; - // hvlad: TODO error message like - // "Execute statement error at %s :\n%sStatement : %s\nData source : %s" or - // "Execute statement error at @1 :\n@2Statement : @3\nData source : @4" - string err; - err.printf("Execute statement error at %s :\n", sWhere); - + string rem_err; if (status) { - string rem_err; m_provider.getRemoteError(status, rem_err); - err += rem_err; if (status == tdbb->tdbb_status_vector) { @@ -1307,11 +1302,13 @@ } } - sQuery = sQuery ? sQuery : &m_sql; - err += "Statement : " + sQuery->substr(0, 255) + "\n"; - err += "Data source : " + m_connection.getDataSourceName(); - - ERR_post(isc_random, isc_arg_string, ERR_cstring(err), 0); + // Execute statement error at @1 :\n@2Statement : @3\nData source : @4 + ERR_post(isc_eds_statement, + isc_arg_string, sWhere, + isc_arg_string, ERR_cstring(rem_err), + isc_arg_string, ERR_cstring(sQuery ? sQuery->substr(0, 255) : m_sql), + isc_arg_string, ERR_cstring(m_connection.getDataSourceName()), + isc_arg_end); } void Statement::bindToRequest(jrd_req* request, Statement** impure) |