@@ -2858,7 +2858,7 @@ getClientTableName(ConnectionClass *conn, char *serverTableName, BOOL *nameAlloc
2858
2858
return ret ;
2859
2859
if (!conn -> server_encoding )
2860
2860
{
2861
- if (res = CC_send_query (conn , "select getdatabaseencoding()" , NULL , TRUE ), res )
2861
+ if (res = CC_send_query (conn , "select getdatabaseencoding()" , NULL , CLEAR_RESULT_ON_ABORT ), res )
2862
2862
{
2863
2863
if (QR_get_num_tuples (res ) > 0 )
2864
2864
conn -> server_encoding = strdup (QR_get_value_backend_row (res , 0 , 0 ));
@@ -2868,11 +2868,11 @@ getClientTableName(ConnectionClass *conn, char *serverTableName, BOOL *nameAlloc
2868
2868
if (!conn -> server_encoding )
2869
2869
return ret ;
2870
2870
sprintf (query , "SET CLIENT_ENCODING TO '%s'" , conn -> server_encoding );
2871
- bError = (CC_send_query (conn , query , NULL , TRUE ) == NULL );
2871
+ bError = (CC_send_query (conn , query , NULL , CLEAR_RESULT_ON_ABORT ) == NULL );
2872
2872
if (!bError && continueExec )
2873
2873
{
2874
2874
sprintf (query , "select OID from pg_class where relname = '%s'" , serverTableName );
2875
- if (res = CC_send_query (conn , query , NULL , TRUE ), res )
2875
+ if (res = CC_send_query (conn , query , NULL , CLEAR_RESULT_ON_ABORT ), res )
2876
2876
{
2877
2877
if (QR_get_num_tuples (res ) > 0 )
2878
2878
strcpy (saveoid , QR_get_value_backend_row (res , 0 , 0 ));
@@ -2891,11 +2891,11 @@ getClientTableName(ConnectionClass *conn, char *serverTableName, BOOL *nameAlloc
2891
2891
}
2892
2892
/* restore the client encoding */
2893
2893
sprintf (query , "SET CLIENT_ENCODING TO '%s'" , conn -> client_encoding );
2894
- bError = (CC_send_query (conn , query , NULL , TRUE ) == NULL );
2894
+ bError = (CC_send_query (conn , query , NULL , CLEAR_RESULT_ON_ABORT ) == NULL );
2895
2895
if (bError || !continueExec )
2896
2896
return ret ;
2897
2897
sprintf (query , "select relname from pg_class where OID = %s" , saveoid );
2898
- if (res = CC_send_query (conn , query , NULL , TRUE ), res )
2898
+ if (res = CC_send_query (conn , query , NULL , CLEAR_RESULT_ON_ABORT ), res )
2899
2899
{
2900
2900
if (QR_get_num_tuples (res ) > 0 )
2901
2901
{
@@ -2922,7 +2922,7 @@ getClientColumnName(ConnectionClass *conn, const char *serverTableName, char *se
2922
2922
return ret ;
2923
2923
if (!conn -> server_encoding )
2924
2924
{
2925
- if (res = CC_send_query (conn , "select getdatabaseencoding()" , NULL , TRUE ), res )
2925
+ if (res = CC_send_query (conn , "select getdatabaseencoding()" , NULL , CLEAR_RESULT_ON_ABORT ), res )
2926
2926
{
2927
2927
if (QR_get_num_tuples (res ) > 0 )
2928
2928
conn -> server_encoding = strdup (QR_get_value_backend_row (res , 0 , 0 ));
@@ -2932,13 +2932,13 @@ getClientColumnName(ConnectionClass *conn, const char *serverTableName, char *se
2932
2932
if (!conn -> server_encoding )
2933
2933
return ret ;
2934
2934
sprintf (query , "SET CLIENT_ENCODING TO '%s'" , conn -> server_encoding );
2935
- bError = (CC_send_query (conn , query , NULL , TRUE ) == NULL );
2935
+ bError = (CC_send_query (conn , query , NULL , CLEAR_RESULT_ON_ABORT ) == NULL );
2936
2936
if (!bError && continueExec )
2937
2937
{
2938
2938
sprintf (query , "select attrelid, attnum from pg_class, pg_attribute "
2939
2939
"where relname = '%s' and attrelid = pg_class.oid "
2940
2940
"and attname = '%s'" , serverTableName , serverColumnName );
2941
- if (res = CC_send_query (conn , query , NULL , TRUE ), res )
2941
+ if (res = CC_send_query (conn , query , NULL , CLEAR_RESULT_ON_ABORT ), res )
2942
2942
{
2943
2943
if (QR_get_num_tuples (res ) > 0 )
2944
2944
{
@@ -2960,11 +2960,11 @@ getClientColumnName(ConnectionClass *conn, const char *serverTableName, char *se
2960
2960
}
2961
2961
/* restore the cleint encoding */
2962
2962
sprintf (query , "SET CLIENT_ENCODING TO '%s'" , conn -> client_encoding );
2963
- bError = (CC_send_query (conn , query , NULL , TRUE ) == NULL );
2963
+ bError = (CC_send_query (conn , query , NULL , CLEAR_RESULT_ON_ABORT ) == NULL );
2964
2964
if (bError || !continueExec )
2965
2965
return ret ;
2966
2966
sprintf (query , "select attname from pg_attribute where attrelid = %s and attnum = %s" , saveattrelid , saveattnum );
2967
- if (res = CC_send_query (conn , query , NULL , TRUE ), res )
2967
+ if (res = CC_send_query (conn , query , NULL , CLEAR_RESULT_ON_ABORT ), res )
2968
2968
{
2969
2969
if (QR_get_num_tuples (res ) > 0 )
2970
2970
{
@@ -3790,7 +3790,7 @@ PGAPI_Procedures(
3790
3790
" case when prorettype = 0 then 1::int2 else 2::int2 end as " "PROCEDURE_TYPE" " from pg_proc" );
3791
3791
my_strcat (proc_query , " where proname like '%.*s'" , szProcName , cbProcName );
3792
3792
3793
- if (res = CC_send_query (conn , proc_query , NULL , TRUE ), !res )
3793
+ if (res = CC_send_query (conn , proc_query , NULL , CLEAR_RESULT_ON_ABORT ), !res )
3794
3794
{
3795
3795
stmt -> errornumber = STMT_EXEC_ERROR ;
3796
3796
stmt -> errormsg = "PGAPI_Procedures query error" ;
@@ -3927,15 +3927,15 @@ PGAPI_TablePrivileges(
3927
3927
my_strcat (proc_query , " relname like '%.*s' and" , esc_table_name , escTbnamelen );
3928
3928
}
3929
3929
strcat (proc_query , " pg_user.usesysid = relowner" );
3930
- if (res = CC_send_query (conn , proc_query , NULL , TRUE ), !res )
3930
+ if (res = CC_send_query (conn , proc_query , NULL , CLEAR_RESULT_ON_ABORT ), !res )
3931
3931
{
3932
3932
stmt -> errornumber = STMT_EXEC_ERROR ;
3933
3933
stmt -> errormsg = "PGAPI_TablePrivileges query error" ;
3934
3934
return SQL_ERROR ;
3935
3935
}
3936
3936
strncpy_null (proc_query , "select usename, usesysid, usesuper from pg_user" , sizeof (proc_query ));
3937
3937
tablecount = QR_get_num_tuples (res );
3938
- if (allures = CC_send_query (conn , proc_query , NULL , TRUE ), !allures )
3938
+ if (allures = CC_send_query (conn , proc_query , NULL , CLEAR_RESULT_ON_ABORT ), !allures )
3939
3939
{
3940
3940
QR_Destructor (res );
3941
3941
stmt -> errornumber = STMT_EXEC_ERROR ;
@@ -3983,7 +3983,7 @@ PGAPI_TablePrivileges(
3983
3983
char * grolist , * uid , * delm ;
3984
3984
3985
3985
snprintf (proc_query , sizeof (proc_query ) - 1 , "select grolist from pg_group where groname = '%s'" , user );
3986
- if (gres = CC_send_query (conn , proc_query , NULL , TRUE ))
3986
+ if (gres = CC_send_query (conn , proc_query , NULL , CLEAR_RESULT_ON_ABORT ))
3987
3987
{
3988
3988
grolist = QR_get_value_backend_row (gres , 0 , 0 );
3989
3989
if (grolist && grolist [0 ] == '{' )
0 commit comments