mirror of
				https://github.com/postgres/postgres.git
				synced 2025-11-03 09:13:20 +03:00 
			
		
		
		
	Remove unnecessary parentheses in return statements
The parenthesized style has only been used in a few modules. Change that to use the style that is predominant across the whole tree. Reviewed-by: Michael Paquier <michael.paquier@gmail.com> Reviewed-by: Ryan Murphy <ryanfmurphy@gmail.com>
This commit is contained in:
		@@ -79,7 +79,7 @@ deccall2(decimal *arg1, decimal *arg2, int (*ptr) (numeric *, numeric *))
 | 
			
		||||
	PGTYPESnumeric_free(a1);
 | 
			
		||||
	PGTYPESnumeric_free(a2);
 | 
			
		||||
 | 
			
		||||
	return (i);
 | 
			
		||||
	return i;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static int
 | 
			
		||||
@@ -143,7 +143,7 @@ deccall3(decimal *arg1, decimal *arg2, decimal *result, int (*ptr) (numeric *, n
 | 
			
		||||
	PGTYPESnumeric_free(a1);
 | 
			
		||||
	PGTYPESnumeric_free(a2);
 | 
			
		||||
 | 
			
		||||
	return (i);
 | 
			
		||||
	return i;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* we start with the numeric functions */
 | 
			
		||||
@@ -166,7 +166,7 @@ decadd(decimal *arg1, decimal *arg2, decimal *sum)
 | 
			
		||||
int
 | 
			
		||||
deccmp(decimal *arg1, decimal *arg2)
 | 
			
		||||
{
 | 
			
		||||
	return (deccall2(arg1, arg2, PGTYPESnumeric_cmp));
 | 
			
		||||
	return deccall2(arg1, arg2, PGTYPESnumeric_cmp);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
@@ -261,7 +261,7 @@ deccvdbl(double dbl, decimal *np)
 | 
			
		||||
		result = PGTYPESnumeric_to_decimal(nres, np);
 | 
			
		||||
 | 
			
		||||
	PGTYPESnumeric_free(nres);
 | 
			
		||||
	return (result);
 | 
			
		||||
	return result;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int
 | 
			
		||||
@@ -283,7 +283,7 @@ deccvint(int in, decimal *np)
 | 
			
		||||
		result = PGTYPESnumeric_to_decimal(nres, np);
 | 
			
		||||
 | 
			
		||||
	PGTYPESnumeric_free(nres);
 | 
			
		||||
	return (result);
 | 
			
		||||
	return result;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int
 | 
			
		||||
@@ -305,7 +305,7 @@ deccvlong(long lng, decimal *np)
 | 
			
		||||
		result = PGTYPESnumeric_to_decimal(nres, np);
 | 
			
		||||
 | 
			
		||||
	PGTYPESnumeric_free(nres);
 | 
			
		||||
	return (result);
 | 
			
		||||
	return result;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int
 | 
			
		||||
@@ -598,7 +598,7 @@ rmdyjul(short mdy[3], date * d)
 | 
			
		||||
int
 | 
			
		||||
rdayofweek(date d)
 | 
			
		||||
{
 | 
			
		||||
	return (PGTYPESdate_dayofweek(d));
 | 
			
		||||
	return PGTYPESdate_dayofweek(d);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* And the datetime stuff */
 | 
			
		||||
@@ -1049,5 +1049,5 @@ rsetnull(int t, char *ptr)
 | 
			
		||||
int
 | 
			
		||||
risnull(int t, char *ptr)
 | 
			
		||||
{
 | 
			
		||||
	return (ECPGis_noind_null(t, ptr));
 | 
			
		||||
	return ECPGis_noind_null(t, ptr);
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -67,7 +67,7 @@ ecpg_get_connection_nr(const char *connection_name)
 | 
			
		||||
		ret = con;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return (ret);
 | 
			
		||||
	return ret;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
struct connection *
 | 
			
		||||
@@ -106,7 +106,7 @@ ecpg_get_connection(const char *connection_name)
 | 
			
		||||
#endif
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return (ret);
 | 
			
		||||
	return ret;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
@@ -168,7 +168,7 @@ ECPGsetcommit(int lineno, const char *mode, const char *connection_name)
 | 
			
		||||
	PGresult   *results;
 | 
			
		||||
 | 
			
		||||
	if (!ecpg_init(con, connection_name, lineno))
 | 
			
		||||
		return (false);
 | 
			
		||||
		return false;
 | 
			
		||||
 | 
			
		||||
	ecpg_log("ECPGsetcommit on line %d: action \"%s\"; connection \"%s\"\n", lineno, mode, con->name);
 | 
			
		||||
 | 
			
		||||
@@ -204,7 +204,7 @@ ECPGsetconn(int lineno, const char *connection_name)
 | 
			
		||||
	struct connection *con = ecpg_get_connection(connection_name);
 | 
			
		||||
 | 
			
		||||
	if (!ecpg_init(con, connection_name, lineno))
 | 
			
		||||
		return (false);
 | 
			
		||||
		return false;
 | 
			
		||||
 | 
			
		||||
#ifdef ENABLE_THREAD_SAFETY
 | 
			
		||||
	pthread_setspecific(actual_connection_key, con);
 | 
			
		||||
@@ -675,7 +675,7 @@ ECPGdisconnect(int lineno, const char *connection_name)
 | 
			
		||||
	{
 | 
			
		||||
		ecpg_raise(lineno, ECPG_OUT_OF_MEMORY,
 | 
			
		||||
				   ECPG_SQLSTATE_ECPG_OUT_OF_MEMORY, NULL);
 | 
			
		||||
		return (false);
 | 
			
		||||
		return false;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
#ifdef ENABLE_THREAD_SAFETY
 | 
			
		||||
@@ -702,7 +702,7 @@ ECPGdisconnect(int lineno, const char *connection_name)
 | 
			
		||||
#ifdef ENABLE_THREAD_SAFETY
 | 
			
		||||
			pthread_mutex_unlock(&connections_mutex);
 | 
			
		||||
#endif
 | 
			
		||||
			return (false);
 | 
			
		||||
			return false;
 | 
			
		||||
		}
 | 
			
		||||
		else
 | 
			
		||||
			ecpg_finish(con);
 | 
			
		||||
 
 | 
			
		||||
@@ -134,7 +134,7 @@ ecpg_get_data(const PGresult *results, int act_tuple, int act_field, int lineno,
 | 
			
		||||
	{
 | 
			
		||||
		ecpg_raise(lineno, ECPG_OUT_OF_MEMORY,
 | 
			
		||||
				   ECPG_SQLSTATE_ECPG_OUT_OF_MEMORY, NULL);
 | 
			
		||||
		return (false);
 | 
			
		||||
		return false;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/*
 | 
			
		||||
@@ -156,7 +156,7 @@ ecpg_get_data(const PGresult *results, int act_tuple, int act_field, int lineno,
 | 
			
		||||
		 * at least one tuple, but let's play it safe.
 | 
			
		||||
		 */
 | 
			
		||||
		ecpg_raise(lineno, ECPG_NOT_FOUND, ECPG_SQLSTATE_NO_DATA, NULL);
 | 
			
		||||
		return (false);
 | 
			
		||||
		return false;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/* We will have to decode the value */
 | 
			
		||||
@@ -204,7 +204,7 @@ ecpg_get_data(const PGresult *results, int act_tuple, int act_field, int lineno,
 | 
			
		||||
					ecpg_raise(lineno, ECPG_MISSING_INDICATOR,
 | 
			
		||||
							   ECPG_SQLSTATE_NULL_VALUE_NO_INDICATOR_PARAMETER,
 | 
			
		||||
							   NULL);
 | 
			
		||||
					return (false);
 | 
			
		||||
					return false;
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
			break;
 | 
			
		||||
@@ -212,12 +212,12 @@ ecpg_get_data(const PGresult *results, int act_tuple, int act_field, int lineno,
 | 
			
		||||
			ecpg_raise(lineno, ECPG_UNSUPPORTED,
 | 
			
		||||
					   ECPG_SQLSTATE_ECPG_INTERNAL_ERROR,
 | 
			
		||||
					   ecpg_type_name(ind_type));
 | 
			
		||||
			return (false);
 | 
			
		||||
			return false;
 | 
			
		||||
			break;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if (value_for_indicator == -1)
 | 
			
		||||
		return (true);
 | 
			
		||||
		return true;
 | 
			
		||||
 | 
			
		||||
	/* let's check if it really is an array if it should be one */
 | 
			
		||||
	if (isarray == ECPG_ARRAY_ARRAY)
 | 
			
		||||
@@ -226,7 +226,7 @@ ecpg_get_data(const PGresult *results, int act_tuple, int act_field, int lineno,
 | 
			
		||||
		{
 | 
			
		||||
			ecpg_raise(lineno, ECPG_DATA_NOT_ARRAY,
 | 
			
		||||
					   ECPG_SQLSTATE_DATATYPE_MISMATCH, NULL);
 | 
			
		||||
			return (false);
 | 
			
		||||
			return false;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		switch (type)
 | 
			
		||||
@@ -307,7 +307,7 @@ ecpg_get_data(const PGresult *results, int act_tuple, int act_field, int lineno,
 | 
			
		||||
					{
 | 
			
		||||
						ecpg_raise(lineno, ECPG_INT_FORMAT,
 | 
			
		||||
								   ECPG_SQLSTATE_DATATYPE_MISMATCH, pval);
 | 
			
		||||
						return (false);
 | 
			
		||||
						return false;
 | 
			
		||||
					}
 | 
			
		||||
					pval = scan_length;
 | 
			
		||||
 | 
			
		||||
@@ -336,7 +336,7 @@ ecpg_get_data(const PGresult *results, int act_tuple, int act_field, int lineno,
 | 
			
		||||
					{
 | 
			
		||||
						ecpg_raise(lineno, ECPG_UINT_FORMAT,
 | 
			
		||||
								   ECPG_SQLSTATE_DATATYPE_MISMATCH, pval);
 | 
			
		||||
						return (false);
 | 
			
		||||
						return false;
 | 
			
		||||
					}
 | 
			
		||||
					pval = scan_length;
 | 
			
		||||
 | 
			
		||||
@@ -364,7 +364,7 @@ ecpg_get_data(const PGresult *results, int act_tuple, int act_field, int lineno,
 | 
			
		||||
					if (garbage_left(isarray, scan_length, compat))
 | 
			
		||||
					{
 | 
			
		||||
						ecpg_raise(lineno, ECPG_INT_FORMAT, ECPG_SQLSTATE_DATATYPE_MISMATCH, pval);
 | 
			
		||||
						return (false);
 | 
			
		||||
						return false;
 | 
			
		||||
					}
 | 
			
		||||
					pval = scan_length;
 | 
			
		||||
 | 
			
		||||
@@ -376,7 +376,7 @@ ecpg_get_data(const PGresult *results, int act_tuple, int act_field, int lineno,
 | 
			
		||||
					if (garbage_left(isarray, scan_length, compat))
 | 
			
		||||
					{
 | 
			
		||||
						ecpg_raise(lineno, ECPG_UINT_FORMAT, ECPG_SQLSTATE_DATATYPE_MISMATCH, pval);
 | 
			
		||||
						return (false);
 | 
			
		||||
						return false;
 | 
			
		||||
					}
 | 
			
		||||
					pval = scan_length;
 | 
			
		||||
 | 
			
		||||
@@ -399,7 +399,7 @@ ecpg_get_data(const PGresult *results, int act_tuple, int act_field, int lineno,
 | 
			
		||||
					{
 | 
			
		||||
						ecpg_raise(lineno, ECPG_FLOAT_FORMAT,
 | 
			
		||||
								   ECPG_SQLSTATE_DATATYPE_MISMATCH, pval);
 | 
			
		||||
						return (false);
 | 
			
		||||
						return false;
 | 
			
		||||
					}
 | 
			
		||||
					pval = scan_length;
 | 
			
		||||
 | 
			
		||||
@@ -438,7 +438,7 @@ ecpg_get_data(const PGresult *results, int act_tuple, int act_field, int lineno,
 | 
			
		||||
 | 
			
		||||
					ecpg_raise(lineno, ECPG_CONVERT_BOOL,
 | 
			
		||||
							   ECPG_SQLSTATE_DATATYPE_MISMATCH, pval);
 | 
			
		||||
					return (false);
 | 
			
		||||
					return false;
 | 
			
		||||
					break;
 | 
			
		||||
 | 
			
		||||
				case ECPGt_char:
 | 
			
		||||
@@ -581,14 +581,14 @@ ecpg_get_data(const PGresult *results, int act_tuple, int act_field, int lineno,
 | 
			
		||||
							{
 | 
			
		||||
								ecpg_raise(lineno, ECPG_OUT_OF_MEMORY,
 | 
			
		||||
										   ECPG_SQLSTATE_ECPG_OUT_OF_MEMORY, NULL);
 | 
			
		||||
								return (false);
 | 
			
		||||
								return false;
 | 
			
		||||
							}
 | 
			
		||||
						}
 | 
			
		||||
						else
 | 
			
		||||
						{
 | 
			
		||||
							ecpg_raise(lineno, ECPG_NUMERIC_FORMAT,
 | 
			
		||||
									   ECPG_SQLSTATE_DATATYPE_MISMATCH, pval);
 | 
			
		||||
							return (false);
 | 
			
		||||
							return false;
 | 
			
		||||
						}
 | 
			
		||||
					}
 | 
			
		||||
					else
 | 
			
		||||
@@ -598,7 +598,7 @@ ecpg_get_data(const PGresult *results, int act_tuple, int act_field, int lineno,
 | 
			
		||||
							free(nres);
 | 
			
		||||
							ecpg_raise(lineno, ECPG_NUMERIC_FORMAT,
 | 
			
		||||
									   ECPG_SQLSTATE_DATATYPE_MISMATCH, pval);
 | 
			
		||||
							return (false);
 | 
			
		||||
							return false;
 | 
			
		||||
						}
 | 
			
		||||
					}
 | 
			
		||||
					pval = scan_length;
 | 
			
		||||
@@ -635,7 +635,7 @@ ecpg_get_data(const PGresult *results, int act_tuple, int act_field, int lineno,
 | 
			
		||||
							 */
 | 
			
		||||
							ires = (interval *) ecpg_alloc(sizeof(interval), lineno);
 | 
			
		||||
							if (!ires)
 | 
			
		||||
								return (false);
 | 
			
		||||
								return false;
 | 
			
		||||
 | 
			
		||||
							ECPGset_noind_null(ECPGt_interval, ires);
 | 
			
		||||
						}
 | 
			
		||||
@@ -643,7 +643,7 @@ ecpg_get_data(const PGresult *results, int act_tuple, int act_field, int lineno,
 | 
			
		||||
						{
 | 
			
		||||
							ecpg_raise(lineno, ECPG_INTERVAL_FORMAT,
 | 
			
		||||
									   ECPG_SQLSTATE_DATATYPE_MISMATCH, pval);
 | 
			
		||||
							return (false);
 | 
			
		||||
							return false;
 | 
			
		||||
						}
 | 
			
		||||
					}
 | 
			
		||||
					else
 | 
			
		||||
@@ -656,7 +656,7 @@ ecpg_get_data(const PGresult *results, int act_tuple, int act_field, int lineno,
 | 
			
		||||
							free(ires);
 | 
			
		||||
							ecpg_raise(lineno, ECPG_INTERVAL_FORMAT,
 | 
			
		||||
									   ECPG_SQLSTATE_DATATYPE_MISMATCH, pval);
 | 
			
		||||
							return (false);
 | 
			
		||||
							return false;
 | 
			
		||||
						}
 | 
			
		||||
					}
 | 
			
		||||
					pval = scan_length;
 | 
			
		||||
@@ -693,7 +693,7 @@ ecpg_get_data(const PGresult *results, int act_tuple, int act_field, int lineno,
 | 
			
		||||
						{
 | 
			
		||||
							ecpg_raise(lineno, ECPG_DATE_FORMAT,
 | 
			
		||||
									   ECPG_SQLSTATE_DATATYPE_MISMATCH, pval);
 | 
			
		||||
							return (false);
 | 
			
		||||
							return false;
 | 
			
		||||
						}
 | 
			
		||||
					}
 | 
			
		||||
					else
 | 
			
		||||
@@ -705,7 +705,7 @@ ecpg_get_data(const PGresult *results, int act_tuple, int act_field, int lineno,
 | 
			
		||||
						{
 | 
			
		||||
							ecpg_raise(lineno, ECPG_DATE_FORMAT,
 | 
			
		||||
									   ECPG_SQLSTATE_DATATYPE_MISMATCH, pval);
 | 
			
		||||
							return (false);
 | 
			
		||||
							return false;
 | 
			
		||||
						}
 | 
			
		||||
					}
 | 
			
		||||
 | 
			
		||||
@@ -741,7 +741,7 @@ ecpg_get_data(const PGresult *results, int act_tuple, int act_field, int lineno,
 | 
			
		||||
						{
 | 
			
		||||
							ecpg_raise(lineno, ECPG_TIMESTAMP_FORMAT,
 | 
			
		||||
									   ECPG_SQLSTATE_DATATYPE_MISMATCH, pval);
 | 
			
		||||
							return (false);
 | 
			
		||||
							return false;
 | 
			
		||||
						}
 | 
			
		||||
					}
 | 
			
		||||
					else
 | 
			
		||||
@@ -753,7 +753,7 @@ ecpg_get_data(const PGresult *results, int act_tuple, int act_field, int lineno,
 | 
			
		||||
						{
 | 
			
		||||
							ecpg_raise(lineno, ECPG_TIMESTAMP_FORMAT,
 | 
			
		||||
									   ECPG_SQLSTATE_DATATYPE_MISMATCH, pval);
 | 
			
		||||
							return (false);
 | 
			
		||||
							return false;
 | 
			
		||||
						}
 | 
			
		||||
					}
 | 
			
		||||
 | 
			
		||||
@@ -765,7 +765,7 @@ ecpg_get_data(const PGresult *results, int act_tuple, int act_field, int lineno,
 | 
			
		||||
					ecpg_raise(lineno, ECPG_UNSUPPORTED,
 | 
			
		||||
							   ECPG_SQLSTATE_ECPG_INTERNAL_ERROR,
 | 
			
		||||
							   ecpg_type_name(type));
 | 
			
		||||
					return (false);
 | 
			
		||||
					return false;
 | 
			
		||||
					break;
 | 
			
		||||
			}
 | 
			
		||||
			if (ECPG_IS_ARRAY(isarray))
 | 
			
		||||
@@ -791,5 +791,5 @@ ecpg_get_data(const PGresult *results, int act_tuple, int act_field, int lineno,
 | 
			
		||||
		}
 | 
			
		||||
	} while (*pval != '\0' && !array_boundary(isarray, *pval));
 | 
			
		||||
 | 
			
		||||
	return (true);
 | 
			
		||||
	return true;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -150,10 +150,10 @@ get_int_item(int lineno, void *var, enum ECPGttype vartype, int value)
 | 
			
		||||
			break;
 | 
			
		||||
		default:
 | 
			
		||||
			ecpg_raise(lineno, ECPG_VAR_NOT_NUMERIC, ECPG_SQLSTATE_RESTRICTED_DATA_TYPE_ATTRIBUTE_VIOLATION, NULL);
 | 
			
		||||
			return (false);
 | 
			
		||||
			return false;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return (true);
 | 
			
		||||
	return true;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static bool
 | 
			
		||||
@@ -195,7 +195,7 @@ set_int_item(int lineno, int *target, const void *var, enum ECPGttype vartype)
 | 
			
		||||
			break;
 | 
			
		||||
		default:
 | 
			
		||||
			ecpg_raise(lineno, ECPG_VAR_NOT_NUMERIC, ECPG_SQLSTATE_RESTRICTED_DATA_TYPE_ATTRIBUTE_VIOLATION, NULL);
 | 
			
		||||
			return (false);
 | 
			
		||||
			return false;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return true;
 | 
			
		||||
@@ -228,17 +228,17 @@ get_char_item(int lineno, void *var, enum ECPGttype vartype, char *value, int va
 | 
			
		||||
			break;
 | 
			
		||||
		default:
 | 
			
		||||
			ecpg_raise(lineno, ECPG_VAR_NOT_CHAR, ECPG_SQLSTATE_RESTRICTED_DATA_TYPE_ATTRIBUTE_VIOLATION, NULL);
 | 
			
		||||
			return (false);
 | 
			
		||||
			return false;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return (true);
 | 
			
		||||
	return true;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#define RETURN_IF_NO_DATA	if (ntuples < 1) \
 | 
			
		||||
				{ \
 | 
			
		||||
					va_end(args); \
 | 
			
		||||
					ecpg_raise(lineno, ECPG_NOT_FOUND, ECPG_SQLSTATE_NO_DATA, NULL); \
 | 
			
		||||
					return (false); \
 | 
			
		||||
					return false; \
 | 
			
		||||
				}
 | 
			
		||||
 | 
			
		||||
bool
 | 
			
		||||
@@ -265,7 +265,7 @@ ECPGget_desc(int lineno, const char *desc_name, int index,...)
 | 
			
		||||
	if (!ECPGresult)
 | 
			
		||||
	{
 | 
			
		||||
		va_end(args);
 | 
			
		||||
		return (false);
 | 
			
		||||
		return false;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	ntuples = PQntuples(ECPGresult);
 | 
			
		||||
@@ -274,7 +274,7 @@ ECPGget_desc(int lineno, const char *desc_name, int index,...)
 | 
			
		||||
	{
 | 
			
		||||
		ecpg_raise(lineno, ECPG_INVALID_DESCRIPTOR_INDEX, ECPG_SQLSTATE_INVALID_DESCRIPTOR_INDEX, NULL);
 | 
			
		||||
		va_end(args);
 | 
			
		||||
		return (false);
 | 
			
		||||
		return false;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	ecpg_log("ECPGget_desc: reading items for tuple %d\n", index);
 | 
			
		||||
@@ -333,7 +333,7 @@ ECPGget_desc(int lineno, const char *desc_name, int index,...)
 | 
			
		||||
				if (!get_char_item(lineno, var, vartype, PQfname(ECPGresult, index), varcharsize))
 | 
			
		||||
				{
 | 
			
		||||
					va_end(args);
 | 
			
		||||
					return (false);
 | 
			
		||||
					return false;
 | 
			
		||||
				}
 | 
			
		||||
 | 
			
		||||
				ecpg_log("ECPGget_desc: NAME = %s\n", PQfname(ECPGresult, index));
 | 
			
		||||
@@ -343,7 +343,7 @@ ECPGget_desc(int lineno, const char *desc_name, int index,...)
 | 
			
		||||
				if (!get_int_item(lineno, var, vartype, 1))
 | 
			
		||||
				{
 | 
			
		||||
					va_end(args);
 | 
			
		||||
					return (false);
 | 
			
		||||
					return false;
 | 
			
		||||
				}
 | 
			
		||||
 | 
			
		||||
				break;
 | 
			
		||||
@@ -352,7 +352,7 @@ ECPGget_desc(int lineno, const char *desc_name, int index,...)
 | 
			
		||||
				if (!get_int_item(lineno, var, vartype, 0))
 | 
			
		||||
				{
 | 
			
		||||
					va_end(args);
 | 
			
		||||
					return (false);
 | 
			
		||||
					return false;
 | 
			
		||||
				}
 | 
			
		||||
 | 
			
		||||
				break;
 | 
			
		||||
@@ -361,7 +361,7 @@ ECPGget_desc(int lineno, const char *desc_name, int index,...)
 | 
			
		||||
				if (!get_int_item(lineno, var, vartype, (PQfmod(ECPGresult, index) - VARHDRSZ) & 0xffff))
 | 
			
		||||
				{
 | 
			
		||||
					va_end(args);
 | 
			
		||||
					return (false);
 | 
			
		||||
					return false;
 | 
			
		||||
				}
 | 
			
		||||
 | 
			
		||||
				ecpg_log("ECPGget_desc: SCALE = %d\n", (PQfmod(ECPGresult, index) - VARHDRSZ) & 0xffff);
 | 
			
		||||
@@ -371,7 +371,7 @@ ECPGget_desc(int lineno, const char *desc_name, int index,...)
 | 
			
		||||
				if (!get_int_item(lineno, var, vartype, PQfmod(ECPGresult, index) >> 16))
 | 
			
		||||
				{
 | 
			
		||||
					va_end(args);
 | 
			
		||||
					return (false);
 | 
			
		||||
					return false;
 | 
			
		||||
				}
 | 
			
		||||
 | 
			
		||||
				ecpg_log("ECPGget_desc: PRECISION = %d\n", PQfmod(ECPGresult, index) >> 16);
 | 
			
		||||
@@ -381,7 +381,7 @@ ECPGget_desc(int lineno, const char *desc_name, int index,...)
 | 
			
		||||
				if (!get_int_item(lineno, var, vartype, PQfsize(ECPGresult, index)))
 | 
			
		||||
				{
 | 
			
		||||
					va_end(args);
 | 
			
		||||
					return (false);
 | 
			
		||||
					return false;
 | 
			
		||||
				}
 | 
			
		||||
 | 
			
		||||
				ecpg_log("ECPGget_desc: OCTET_LENGTH = %d\n", PQfsize(ECPGresult, index));
 | 
			
		||||
@@ -391,7 +391,7 @@ ECPGget_desc(int lineno, const char *desc_name, int index,...)
 | 
			
		||||
				if (!get_int_item(lineno, var, vartype, PQfmod(ECPGresult, index) - VARHDRSZ))
 | 
			
		||||
				{
 | 
			
		||||
					va_end(args);
 | 
			
		||||
					return (false);
 | 
			
		||||
					return false;
 | 
			
		||||
				}
 | 
			
		||||
 | 
			
		||||
				ecpg_log("ECPGget_desc: LENGTH = %d\n", PQfmod(ECPGresult, index) - VARHDRSZ);
 | 
			
		||||
@@ -401,7 +401,7 @@ ECPGget_desc(int lineno, const char *desc_name, int index,...)
 | 
			
		||||
				if (!get_int_item(lineno, var, vartype, ecpg_dynamic_type(PQftype(ECPGresult, index))))
 | 
			
		||||
				{
 | 
			
		||||
					va_end(args);
 | 
			
		||||
					return (false);
 | 
			
		||||
					return false;
 | 
			
		||||
				}
 | 
			
		||||
 | 
			
		||||
				ecpg_log("ECPGget_desc: TYPE = %d\n", ecpg_dynamic_type(PQftype(ECPGresult, index)));
 | 
			
		||||
@@ -411,7 +411,7 @@ ECPGget_desc(int lineno, const char *desc_name, int index,...)
 | 
			
		||||
				if (!get_int_item(lineno, var, vartype, ecpg_dynamic_type_DDT(PQftype(ECPGresult, index))))
 | 
			
		||||
				{
 | 
			
		||||
					va_end(args);
 | 
			
		||||
					return (false);
 | 
			
		||||
					return false;
 | 
			
		||||
				}
 | 
			
		||||
 | 
			
		||||
				ecpg_log("ECPGget_desc: TYPE = %d\n", ecpg_dynamic_type_DDT(PQftype(ECPGresult, index)));
 | 
			
		||||
@@ -421,7 +421,7 @@ ECPGget_desc(int lineno, const char *desc_name, int index,...)
 | 
			
		||||
				if (!get_int_item(lineno, var, vartype, PQntuples(ECPGresult)))
 | 
			
		||||
				{
 | 
			
		||||
					va_end(args);
 | 
			
		||||
					return (false);
 | 
			
		||||
					return false;
 | 
			
		||||
				}
 | 
			
		||||
 | 
			
		||||
				ecpg_log("ECPGget_desc: CARDINALITY = %d\n", PQntuples(ECPGresult));
 | 
			
		||||
@@ -462,7 +462,7 @@ ECPGget_desc(int lineno, const char *desc_name, int index,...)
 | 
			
		||||
					if (!get_int_item(lineno, var, vartype, PQgetlength(ECPGresult, act_tuple, index)))
 | 
			
		||||
					{
 | 
			
		||||
						va_end(args);
 | 
			
		||||
						return (false);
 | 
			
		||||
						return false;
 | 
			
		||||
					}
 | 
			
		||||
					var = (char *) var + offset;
 | 
			
		||||
					ecpg_log("ECPGget_desc: RETURNED[%d] = %d\n", act_tuple, PQgetlength(ECPGresult, act_tuple, index));
 | 
			
		||||
@@ -473,7 +473,7 @@ ECPGget_desc(int lineno, const char *desc_name, int index,...)
 | 
			
		||||
				snprintf(type_str, sizeof(type_str), "%d", type);
 | 
			
		||||
				ecpg_raise(lineno, ECPG_UNKNOWN_DESCRIPTOR_ITEM, ECPG_SQLSTATE_ECPG_INTERNAL_ERROR, type_str);
 | 
			
		||||
				va_end(args);
 | 
			
		||||
				return (false);
 | 
			
		||||
				return false;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		type = va_arg(args, enum ECPGdtype);
 | 
			
		||||
@@ -539,7 +539,7 @@ ECPGget_desc(int lineno, const char *desc_name, int index,...)
 | 
			
		||||
			if (!get_int_item(lineno, data_var.ind_value, data_var.ind_type, -PQgetisnull(ECPGresult, act_tuple, index)))
 | 
			
		||||
			{
 | 
			
		||||
				va_end(args);
 | 
			
		||||
				return (false);
 | 
			
		||||
				return false;
 | 
			
		||||
			}
 | 
			
		||||
			data_var.ind_value = (char *) data_var.ind_value + data_var.ind_offset;
 | 
			
		||||
			ecpg_log("ECPGget_desc: INDICATOR[%d] = %d\n", act_tuple, -PQgetisnull(ECPGresult, act_tuple, index));
 | 
			
		||||
@@ -547,7 +547,7 @@ ECPGget_desc(int lineno, const char *desc_name, int index,...)
 | 
			
		||||
	}
 | 
			
		||||
	sqlca->sqlerrd[2] = ntuples;
 | 
			
		||||
	va_end(args);
 | 
			
		||||
	return (true);
 | 
			
		||||
	return true;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#undef RETURN_IF_NO_DATA
 | 
			
		||||
 
 | 
			
		||||
@@ -286,23 +286,23 @@ ecpg_check_PQresult(PGresult *results, int lineno, PGconn *connection, enum COMP
 | 
			
		||||
	{
 | 
			
		||||
		ecpg_log("ecpg_check_PQresult on line %d: no result - %s", lineno, PQerrorMessage(connection));
 | 
			
		||||
		ecpg_raise_backend(lineno, NULL, connection, compat);
 | 
			
		||||
		return (false);
 | 
			
		||||
		return false;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	switch (PQresultStatus(results))
 | 
			
		||||
	{
 | 
			
		||||
 | 
			
		||||
		case PGRES_TUPLES_OK:
 | 
			
		||||
			return (true);
 | 
			
		||||
			return true;
 | 
			
		||||
			break;
 | 
			
		||||
		case PGRES_EMPTY_QUERY:
 | 
			
		||||
			/* do nothing */
 | 
			
		||||
			ecpg_raise(lineno, ECPG_EMPTY, ECPG_SQLSTATE_ECPG_INTERNAL_ERROR, NULL);
 | 
			
		||||
			PQclear(results);
 | 
			
		||||
			return (false);
 | 
			
		||||
			return false;
 | 
			
		||||
			break;
 | 
			
		||||
		case PGRES_COMMAND_OK:
 | 
			
		||||
			return (true);
 | 
			
		||||
			return true;
 | 
			
		||||
			break;
 | 
			
		||||
		case PGRES_NONFATAL_ERROR:
 | 
			
		||||
		case PGRES_FATAL_ERROR:
 | 
			
		||||
@@ -310,23 +310,23 @@ ecpg_check_PQresult(PGresult *results, int lineno, PGconn *connection, enum COMP
 | 
			
		||||
			ecpg_log("ecpg_check_PQresult on line %d: bad response - %s", lineno, PQresultErrorMessage(results));
 | 
			
		||||
			ecpg_raise_backend(lineno, results, connection, compat);
 | 
			
		||||
			PQclear(results);
 | 
			
		||||
			return (false);
 | 
			
		||||
			return false;
 | 
			
		||||
			break;
 | 
			
		||||
		case PGRES_COPY_OUT:
 | 
			
		||||
			return (true);
 | 
			
		||||
			return true;
 | 
			
		||||
			break;
 | 
			
		||||
		case PGRES_COPY_IN:
 | 
			
		||||
			ecpg_log("ecpg_check_PQresult on line %d: COPY IN data transfer in progress\n", lineno);
 | 
			
		||||
			PQendcopy(connection);
 | 
			
		||||
			PQclear(results);
 | 
			
		||||
			return (false);
 | 
			
		||||
			return false;
 | 
			
		||||
			break;
 | 
			
		||||
		default:
 | 
			
		||||
			ecpg_log("ecpg_check_PQresult on line %d: unknown execution status type\n",
 | 
			
		||||
					 lineno);
 | 
			
		||||
			ecpg_raise_backend(lineno, results, connection, compat);
 | 
			
		||||
			PQclear(results);
 | 
			
		||||
			return (false);
 | 
			
		||||
			return false;
 | 
			
		||||
			break;
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -58,7 +58,7 @@ quote_postgres(char *arg, bool quote, int lineno)
 | 
			
		||||
		buffer_len = 2 * length + 1;
 | 
			
		||||
		res = (char *) ecpg_alloc(buffer_len + 3, lineno);
 | 
			
		||||
		if (!res)
 | 
			
		||||
			return (res);
 | 
			
		||||
			return res;
 | 
			
		||||
		escaped_len = PQescapeString(res + 1, arg, buffer_len);
 | 
			
		||||
		if (length == escaped_len)
 | 
			
		||||
		{
 | 
			
		||||
@@ -151,13 +151,13 @@ ecpg_type_infocache_push(struct ECPGtype_information_cache **cache, int oid, enu
 | 
			
		||||
	= (struct ECPGtype_information_cache *) ecpg_alloc(sizeof(struct ECPGtype_information_cache), lineno);
 | 
			
		||||
 | 
			
		||||
	if (new_entry == NULL)
 | 
			
		||||
		return (false);
 | 
			
		||||
		return false;
 | 
			
		||||
 | 
			
		||||
	new_entry->oid = oid;
 | 
			
		||||
	new_entry->isarray = isarray;
 | 
			
		||||
	new_entry->next = *cache;
 | 
			
		||||
	*cache = new_entry;
 | 
			
		||||
	return (true);
 | 
			
		||||
	return true;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static enum ARRAY_TYPE
 | 
			
		||||
@@ -178,89 +178,89 @@ ecpg_is_type_an_array(int type, const struct statement *stmt, const struct varia
 | 
			
		||||
 | 
			
		||||
		/* populate cache with well known types to speed things up */
 | 
			
		||||
		if (!ecpg_type_infocache_push(&(stmt->connection->cache_head), BOOLOID, ECPG_ARRAY_NONE, stmt->lineno))
 | 
			
		||||
			return (ECPG_ARRAY_ERROR);
 | 
			
		||||
			return ECPG_ARRAY_ERROR;
 | 
			
		||||
		if (!ecpg_type_infocache_push(&(stmt->connection->cache_head), BYTEAOID, ECPG_ARRAY_NONE, stmt->lineno))
 | 
			
		||||
			return (ECPG_ARRAY_ERROR);
 | 
			
		||||
			return ECPG_ARRAY_ERROR;
 | 
			
		||||
		if (!ecpg_type_infocache_push(&(stmt->connection->cache_head), CHAROID, ECPG_ARRAY_NONE, stmt->lineno))
 | 
			
		||||
			return (ECPG_ARRAY_ERROR);
 | 
			
		||||
			return ECPG_ARRAY_ERROR;
 | 
			
		||||
		if (!ecpg_type_infocache_push(&(stmt->connection->cache_head), NAMEOID, not_an_array_in_ecpg, stmt->lineno))
 | 
			
		||||
			return (ECPG_ARRAY_ERROR);
 | 
			
		||||
			return ECPG_ARRAY_ERROR;
 | 
			
		||||
		if (!ecpg_type_infocache_push(&(stmt->connection->cache_head), INT8OID, ECPG_ARRAY_NONE, stmt->lineno))
 | 
			
		||||
			return (ECPG_ARRAY_ERROR);
 | 
			
		||||
			return ECPG_ARRAY_ERROR;
 | 
			
		||||
		if (!ecpg_type_infocache_push(&(stmt->connection->cache_head), INT2OID, ECPG_ARRAY_NONE, stmt->lineno))
 | 
			
		||||
			return (ECPG_ARRAY_ERROR);
 | 
			
		||||
			return ECPG_ARRAY_ERROR;
 | 
			
		||||
		if (!ecpg_type_infocache_push(&(stmt->connection->cache_head), INT2VECTOROID, ECPG_ARRAY_VECTOR, stmt->lineno))
 | 
			
		||||
			return (ECPG_ARRAY_ERROR);
 | 
			
		||||
			return ECPG_ARRAY_ERROR;
 | 
			
		||||
		if (!ecpg_type_infocache_push(&(stmt->connection->cache_head), INT4OID, ECPG_ARRAY_NONE, stmt->lineno))
 | 
			
		||||
			return (ECPG_ARRAY_ERROR);
 | 
			
		||||
			return ECPG_ARRAY_ERROR;
 | 
			
		||||
		if (!ecpg_type_infocache_push(&(stmt->connection->cache_head), REGPROCOID, ECPG_ARRAY_NONE, stmt->lineno))
 | 
			
		||||
			return (ECPG_ARRAY_ERROR);
 | 
			
		||||
			return ECPG_ARRAY_ERROR;
 | 
			
		||||
		if (!ecpg_type_infocache_push(&(stmt->connection->cache_head), TEXTOID, ECPG_ARRAY_NONE, stmt->lineno))
 | 
			
		||||
			return (ECPG_ARRAY_ERROR);
 | 
			
		||||
			return ECPG_ARRAY_ERROR;
 | 
			
		||||
		if (!ecpg_type_infocache_push(&(stmt->connection->cache_head), OIDOID, ECPG_ARRAY_NONE, stmt->lineno))
 | 
			
		||||
			return (ECPG_ARRAY_ERROR);
 | 
			
		||||
			return ECPG_ARRAY_ERROR;
 | 
			
		||||
		if (!ecpg_type_infocache_push(&(stmt->connection->cache_head), TIDOID, ECPG_ARRAY_NONE, stmt->lineno))
 | 
			
		||||
			return (ECPG_ARRAY_ERROR);
 | 
			
		||||
			return ECPG_ARRAY_ERROR;
 | 
			
		||||
		if (!ecpg_type_infocache_push(&(stmt->connection->cache_head), XIDOID, ECPG_ARRAY_NONE, stmt->lineno))
 | 
			
		||||
			return (ECPG_ARRAY_ERROR);
 | 
			
		||||
			return ECPG_ARRAY_ERROR;
 | 
			
		||||
		if (!ecpg_type_infocache_push(&(stmt->connection->cache_head), CIDOID, ECPG_ARRAY_NONE, stmt->lineno))
 | 
			
		||||
			return (ECPG_ARRAY_ERROR);
 | 
			
		||||
			return ECPG_ARRAY_ERROR;
 | 
			
		||||
		if (!ecpg_type_infocache_push(&(stmt->connection->cache_head), OIDVECTOROID, ECPG_ARRAY_VECTOR, stmt->lineno))
 | 
			
		||||
			return (ECPG_ARRAY_ERROR);
 | 
			
		||||
			return ECPG_ARRAY_ERROR;
 | 
			
		||||
		if (!ecpg_type_infocache_push(&(stmt->connection->cache_head), POINTOID, ECPG_ARRAY_VECTOR, stmt->lineno))
 | 
			
		||||
			return (ECPG_ARRAY_ERROR);
 | 
			
		||||
			return ECPG_ARRAY_ERROR;
 | 
			
		||||
		if (!ecpg_type_infocache_push(&(stmt->connection->cache_head), LSEGOID, ECPG_ARRAY_VECTOR, stmt->lineno))
 | 
			
		||||
			return (ECPG_ARRAY_ERROR);
 | 
			
		||||
			return ECPG_ARRAY_ERROR;
 | 
			
		||||
		if (!ecpg_type_infocache_push(&(stmt->connection->cache_head), PATHOID, ECPG_ARRAY_NONE, stmt->lineno))
 | 
			
		||||
			return (ECPG_ARRAY_ERROR);
 | 
			
		||||
			return ECPG_ARRAY_ERROR;
 | 
			
		||||
		if (!ecpg_type_infocache_push(&(stmt->connection->cache_head), BOXOID, ECPG_ARRAY_VECTOR, stmt->lineno))
 | 
			
		||||
			return (ECPG_ARRAY_ERROR);
 | 
			
		||||
			return ECPG_ARRAY_ERROR;
 | 
			
		||||
		if (!ecpg_type_infocache_push(&(stmt->connection->cache_head), POLYGONOID, ECPG_ARRAY_NONE, stmt->lineno))
 | 
			
		||||
			return (ECPG_ARRAY_ERROR);
 | 
			
		||||
			return ECPG_ARRAY_ERROR;
 | 
			
		||||
		if (!ecpg_type_infocache_push(&(stmt->connection->cache_head), LINEOID, ECPG_ARRAY_VECTOR, stmt->lineno))
 | 
			
		||||
			return (ECPG_ARRAY_ERROR);
 | 
			
		||||
			return ECPG_ARRAY_ERROR;
 | 
			
		||||
		if (!ecpg_type_infocache_push(&(stmt->connection->cache_head), FLOAT4OID, ECPG_ARRAY_NONE, stmt->lineno))
 | 
			
		||||
			return (ECPG_ARRAY_ERROR);
 | 
			
		||||
			return ECPG_ARRAY_ERROR;
 | 
			
		||||
		if (!ecpg_type_infocache_push(&(stmt->connection->cache_head), FLOAT8OID, ECPG_ARRAY_NONE, stmt->lineno))
 | 
			
		||||
			return (ECPG_ARRAY_ERROR);
 | 
			
		||||
			return ECPG_ARRAY_ERROR;
 | 
			
		||||
		if (!ecpg_type_infocache_push(&(stmt->connection->cache_head), ABSTIMEOID, ECPG_ARRAY_NONE, stmt->lineno))
 | 
			
		||||
			return (ECPG_ARRAY_ERROR);
 | 
			
		||||
			return ECPG_ARRAY_ERROR;
 | 
			
		||||
		if (!ecpg_type_infocache_push(&(stmt->connection->cache_head), RELTIMEOID, ECPG_ARRAY_NONE, stmt->lineno))
 | 
			
		||||
			return (ECPG_ARRAY_ERROR);
 | 
			
		||||
			return ECPG_ARRAY_ERROR;
 | 
			
		||||
		if (!ecpg_type_infocache_push(&(stmt->connection->cache_head), TINTERVALOID, ECPG_ARRAY_NONE, stmt->lineno))
 | 
			
		||||
			return (ECPG_ARRAY_ERROR);
 | 
			
		||||
			return ECPG_ARRAY_ERROR;
 | 
			
		||||
		if (!ecpg_type_infocache_push(&(stmt->connection->cache_head), UNKNOWNOID, ECPG_ARRAY_NONE, stmt->lineno))
 | 
			
		||||
			return (ECPG_ARRAY_ERROR);
 | 
			
		||||
			return ECPG_ARRAY_ERROR;
 | 
			
		||||
		if (!ecpg_type_infocache_push(&(stmt->connection->cache_head), CIRCLEOID, ECPG_ARRAY_NONE, stmt->lineno))
 | 
			
		||||
			return (ECPG_ARRAY_ERROR);
 | 
			
		||||
			return ECPG_ARRAY_ERROR;
 | 
			
		||||
		if (!ecpg_type_infocache_push(&(stmt->connection->cache_head), CASHOID, ECPG_ARRAY_NONE, stmt->lineno))
 | 
			
		||||
			return (ECPG_ARRAY_ERROR);
 | 
			
		||||
			return ECPG_ARRAY_ERROR;
 | 
			
		||||
		if (!ecpg_type_infocache_push(&(stmt->connection->cache_head), INETOID, ECPG_ARRAY_NONE, stmt->lineno))
 | 
			
		||||
			return (ECPG_ARRAY_ERROR);
 | 
			
		||||
			return ECPG_ARRAY_ERROR;
 | 
			
		||||
		if (!ecpg_type_infocache_push(&(stmt->connection->cache_head), CIDROID, ECPG_ARRAY_NONE, stmt->lineno))
 | 
			
		||||
			return (ECPG_ARRAY_ERROR);
 | 
			
		||||
			return ECPG_ARRAY_ERROR;
 | 
			
		||||
		if (!ecpg_type_infocache_push(&(stmt->connection->cache_head), BPCHAROID, ECPG_ARRAY_NONE, stmt->lineno))
 | 
			
		||||
			return (ECPG_ARRAY_ERROR);
 | 
			
		||||
			return ECPG_ARRAY_ERROR;
 | 
			
		||||
		if (!ecpg_type_infocache_push(&(stmt->connection->cache_head), VARCHAROID, ECPG_ARRAY_NONE, stmt->lineno))
 | 
			
		||||
			return (ECPG_ARRAY_ERROR);
 | 
			
		||||
			return ECPG_ARRAY_ERROR;
 | 
			
		||||
		if (!ecpg_type_infocache_push(&(stmt->connection->cache_head), DATEOID, ECPG_ARRAY_NONE, stmt->lineno))
 | 
			
		||||
			return (ECPG_ARRAY_ERROR);
 | 
			
		||||
			return ECPG_ARRAY_ERROR;
 | 
			
		||||
		if (!ecpg_type_infocache_push(&(stmt->connection->cache_head), TIMEOID, ECPG_ARRAY_NONE, stmt->lineno))
 | 
			
		||||
			return (ECPG_ARRAY_ERROR);
 | 
			
		||||
			return ECPG_ARRAY_ERROR;
 | 
			
		||||
		if (!ecpg_type_infocache_push(&(stmt->connection->cache_head), TIMESTAMPOID, ECPG_ARRAY_NONE, stmt->lineno))
 | 
			
		||||
			return (ECPG_ARRAY_ERROR);
 | 
			
		||||
			return ECPG_ARRAY_ERROR;
 | 
			
		||||
		if (!ecpg_type_infocache_push(&(stmt->connection->cache_head), TIMESTAMPTZOID, ECPG_ARRAY_NONE, stmt->lineno))
 | 
			
		||||
			return (ECPG_ARRAY_ERROR);
 | 
			
		||||
			return ECPG_ARRAY_ERROR;
 | 
			
		||||
		if (!ecpg_type_infocache_push(&(stmt->connection->cache_head), INTERVALOID, ECPG_ARRAY_NONE, stmt->lineno))
 | 
			
		||||
			return (ECPG_ARRAY_ERROR);
 | 
			
		||||
			return ECPG_ARRAY_ERROR;
 | 
			
		||||
		if (!ecpg_type_infocache_push(&(stmt->connection->cache_head), TIMETZOID, ECPG_ARRAY_NONE, stmt->lineno))
 | 
			
		||||
			return (ECPG_ARRAY_ERROR);
 | 
			
		||||
			return ECPG_ARRAY_ERROR;
 | 
			
		||||
		if (!ecpg_type_infocache_push(&(stmt->connection->cache_head), ZPBITOID, ECPG_ARRAY_NONE, stmt->lineno))
 | 
			
		||||
			return (ECPG_ARRAY_ERROR);
 | 
			
		||||
			return ECPG_ARRAY_ERROR;
 | 
			
		||||
		if (!ecpg_type_infocache_push(&(stmt->connection->cache_head), VARBITOID, ECPG_ARRAY_NONE, stmt->lineno))
 | 
			
		||||
			return (ECPG_ARRAY_ERROR);
 | 
			
		||||
			return ECPG_ARRAY_ERROR;
 | 
			
		||||
		if (!ecpg_type_infocache_push(&(stmt->connection->cache_head), NUMERICOID, ECPG_ARRAY_NONE, stmt->lineno))
 | 
			
		||||
			return (ECPG_ARRAY_ERROR);
 | 
			
		||||
			return ECPG_ARRAY_ERROR;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	for (cache_entry = (stmt->connection->cache_head); cache_entry != NULL; cache_entry = cache_entry->next)
 | 
			
		||||
@@ -271,13 +271,13 @@ ecpg_is_type_an_array(int type, const struct statement *stmt, const struct varia
 | 
			
		||||
 | 
			
		||||
	array_query = (char *) ecpg_alloc(strlen("select typlen from pg_type where oid= and typelem<>0") + 11, stmt->lineno);
 | 
			
		||||
	if (array_query == NULL)
 | 
			
		||||
		return (ECPG_ARRAY_ERROR);
 | 
			
		||||
		return ECPG_ARRAY_ERROR;
 | 
			
		||||
 | 
			
		||||
	sprintf(array_query, "select typlen from pg_type where oid=%d and typelem<>0", type);
 | 
			
		||||
	query = PQexec(stmt->connection->connection, array_query);
 | 
			
		||||
	ecpg_free(array_query);
 | 
			
		||||
	if (!ecpg_check_PQresult(query, stmt->lineno, stmt->connection->connection, stmt->compat))
 | 
			
		||||
		return (ECPG_ARRAY_ERROR);
 | 
			
		||||
		return ECPG_ARRAY_ERROR;
 | 
			
		||||
	else if (PQresultStatus(query) == PGRES_TUPLES_OK)
 | 
			
		||||
	{
 | 
			
		||||
		if (PQntuples(query) == 0)
 | 
			
		||||
@@ -297,7 +297,7 @@ ecpg_is_type_an_array(int type, const struct statement *stmt, const struct varia
 | 
			
		||||
		PQclear(query);
 | 
			
		||||
	}
 | 
			
		||||
	else
 | 
			
		||||
		return (ECPG_ARRAY_ERROR);
 | 
			
		||||
		return ECPG_ARRAY_ERROR;
 | 
			
		||||
 | 
			
		||||
	ecpg_type_infocache_push(&(stmt->connection->cache_head), type, isarray, stmt->lineno);
 | 
			
		||||
	ecpg_log("ecpg_is_type_an_array on line %d: type (%d); C (%d); array (%s)\n", stmt->lineno, type, var->type, ECPG_IS_ARRAY(isarray) ? "yes" : "no");
 | 
			
		||||
@@ -1486,7 +1486,7 @@ ecpg_process_output(struct statement *stmt, bool clear_result)
 | 
			
		||||
	{
 | 
			
		||||
		ecpg_raise(stmt->lineno, ECPG_OUT_OF_MEMORY,
 | 
			
		||||
				   ECPG_SQLSTATE_ECPG_OUT_OF_MEMORY, NULL);
 | 
			
		||||
		return (false);
 | 
			
		||||
		return false;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	var = stmt->outlist;
 | 
			
		||||
@@ -1654,7 +1654,7 @@ ecpg_process_output(struct statement *stmt, bool clear_result)
 | 
			
		||||
					else if (!INFORMIX_MODE(stmt->compat))
 | 
			
		||||
					{
 | 
			
		||||
						ecpg_raise(stmt->lineno, ECPG_TOO_FEW_ARGUMENTS, ECPG_SQLSTATE_USING_CLAUSE_DOES_NOT_MATCH_TARGETS, NULL);
 | 
			
		||||
						return (false);
 | 
			
		||||
						return false;
 | 
			
		||||
					}
 | 
			
		||||
				}
 | 
			
		||||
 | 
			
		||||
@@ -1830,7 +1830,7 @@ ecpg_do_prologue(int lineno, const int compat, const int force_indicator,
 | 
			
		||||
		{
 | 
			
		||||
			ecpg_raise(lineno, ECPG_INVALID_STMT, ECPG_SQLSTATE_INVALID_SQL_STATEMENT_NAME, stmt->command);
 | 
			
		||||
			ecpg_do_epilogue(stmt);
 | 
			
		||||
			return (false);
 | 
			
		||||
			return false;
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -26,7 +26,7 @@ ecpg_alloc(long size, int lineno)
 | 
			
		||||
		return NULL;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return (new);
 | 
			
		||||
	return new;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
char *
 | 
			
		||||
@@ -40,7 +40,7 @@ ecpg_realloc(void *ptr, long size, int lineno)
 | 
			
		||||
		return NULL;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return (new);
 | 
			
		||||
	return new;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
char *
 | 
			
		||||
@@ -58,7 +58,7 @@ ecpg_strdup(const char *string, int lineno)
 | 
			
		||||
		return NULL;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return (new);
 | 
			
		||||
	return new;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* keep a list of memory we allocated for the user */
 | 
			
		||||
 
 | 
			
		||||
@@ -110,7 +110,7 @@ ecpg_init(const struct connection *con, const char *connection_name, const int l
 | 
			
		||||
	{
 | 
			
		||||
		ecpg_raise(lineno, ECPG_OUT_OF_MEMORY, ECPG_SQLSTATE_ECPG_OUT_OF_MEMORY,
 | 
			
		||||
				   NULL);
 | 
			
		||||
		return (false);
 | 
			
		||||
		return false;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	ecpg_init_sqlca(sqlca);
 | 
			
		||||
@@ -118,10 +118,10 @@ ecpg_init(const struct connection *con, const char *connection_name, const int l
 | 
			
		||||
	{
 | 
			
		||||
		ecpg_raise(lineno, ECPG_NO_CONN, ECPG_SQLSTATE_CONNECTION_DOES_NOT_EXIST,
 | 
			
		||||
				   connection_name ? connection_name : ecpg_gettext("NULL"));
 | 
			
		||||
		return (false);
 | 
			
		||||
		return false;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return (true);
 | 
			
		||||
	return true;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#ifdef ENABLE_THREAD_SAFETY
 | 
			
		||||
@@ -155,9 +155,9 @@ ECPGget_sqlca(void)
 | 
			
		||||
		ecpg_init_sqlca(sqlca);
 | 
			
		||||
		pthread_setspecific(sqlca_key, sqlca);
 | 
			
		||||
	}
 | 
			
		||||
	return (sqlca);
 | 
			
		||||
	return sqlca;
 | 
			
		||||
#else
 | 
			
		||||
	return (&sqlca);
 | 
			
		||||
	return &sqlca;
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -167,7 +167,7 @@ ECPGstatus(int lineno, const char *connection_name)
 | 
			
		||||
	struct connection *con = ecpg_get_connection(connection_name);
 | 
			
		||||
 | 
			
		||||
	if (!ecpg_init(con, connection_name, lineno))
 | 
			
		||||
		return (false);
 | 
			
		||||
		return false;
 | 
			
		||||
 | 
			
		||||
	/* are we connected? */
 | 
			
		||||
	if (con->connection == NULL)
 | 
			
		||||
@@ -176,7 +176,7 @@ ECPGstatus(int lineno, const char *connection_name)
 | 
			
		||||
		return false;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return (true);
 | 
			
		||||
	return true;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
PGTransactionStatusType
 | 
			
		||||
@@ -202,7 +202,7 @@ ECPGtrans(int lineno, const char *connection_name, const char *transaction)
 | 
			
		||||
	struct connection *con = ecpg_get_connection(connection_name);
 | 
			
		||||
 | 
			
		||||
	if (!ecpg_init(con, connection_name, lineno))
 | 
			
		||||
		return (false);
 | 
			
		||||
		return false;
 | 
			
		||||
 | 
			
		||||
	ecpg_log("ECPGtrans on line %d: action \"%s\"; connection \"%s\"\n", lineno, transaction, con ? con->name : "null");
 | 
			
		||||
 | 
			
		||||
@@ -419,10 +419,10 @@ ECPGis_noind_null(enum ECPGttype type, void *ptr)
 | 
			
		||||
			break;
 | 
			
		||||
#endif							/* HAVE_LONG_LONG_INT */
 | 
			
		||||
		case ECPGt_float:
 | 
			
		||||
			return (_check(ptr, sizeof(float)));
 | 
			
		||||
			return _check(ptr, sizeof(float));
 | 
			
		||||
			break;
 | 
			
		||||
		case ECPGt_double:
 | 
			
		||||
			return (_check(ptr, sizeof(double)));
 | 
			
		||||
			return _check(ptr, sizeof(double));
 | 
			
		||||
			break;
 | 
			
		||||
		case ECPGt_varchar:
 | 
			
		||||
			if (*(((struct ECPGgeneric_varchar *) ptr)->arr) == 0x00)
 | 
			
		||||
@@ -437,10 +437,10 @@ ECPGis_noind_null(enum ECPGttype type, void *ptr)
 | 
			
		||||
				return true;
 | 
			
		||||
			break;
 | 
			
		||||
		case ECPGt_interval:
 | 
			
		||||
			return (_check(ptr, sizeof(interval)));
 | 
			
		||||
			return _check(ptr, sizeof(interval));
 | 
			
		||||
			break;
 | 
			
		||||
		case ECPGt_timestamp:
 | 
			
		||||
			return (_check(ptr, sizeof(timestamp)));
 | 
			
		||||
			return _check(ptr, sizeof(timestamp));
 | 
			
		||||
			break;
 | 
			
		||||
		default:
 | 
			
		||||
			break;
 | 
			
		||||
 
 | 
			
		||||
@@ -42,7 +42,7 @@ isvarchar(unsigned char c)
 | 
			
		||||
	if (c >= 128)
 | 
			
		||||
		return true;
 | 
			
		||||
 | 
			
		||||
	return (false);
 | 
			
		||||
	return false;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static bool
 | 
			
		||||
@@ -371,7 +371,7 @@ SearchStmtCache(const char *ecpgQuery)
 | 
			
		||||
	if (entIx >= stmtCacheEntPerBucket)
 | 
			
		||||
		entNo = 0;
 | 
			
		||||
 | 
			
		||||
	return (entNo);
 | 
			
		||||
	return entNo;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
@@ -389,14 +389,14 @@ ecpg_freeStmtCacheEntry(int lineno, int compat, int entNo)	/* entry # to free */
 | 
			
		||||
 | 
			
		||||
	entry = &stmtCacheEntries[entNo];
 | 
			
		||||
	if (!entry->stmtID[0])		/* return if the entry isn't in use     */
 | 
			
		||||
		return (0);
 | 
			
		||||
		return 0;
 | 
			
		||||
 | 
			
		||||
	con = ecpg_get_connection(entry->connection);
 | 
			
		||||
 | 
			
		||||
	/* free the 'prepared_statement' list entry		  */
 | 
			
		||||
	this = ecpg_find_prepared_statement(entry->stmtID, con, &prev);
 | 
			
		||||
	if (this && !deallocate_one(lineno, compat, con, prev, this))
 | 
			
		||||
		return (-1);
 | 
			
		||||
		return -1;
 | 
			
		||||
 | 
			
		||||
	entry->stmtID[0] = '\0';
 | 
			
		||||
 | 
			
		||||
@@ -407,7 +407,7 @@ ecpg_freeStmtCacheEntry(int lineno, int compat, int entNo)	/* entry # to free */
 | 
			
		||||
		entry->ecpgQuery = 0;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return (entNo);
 | 
			
		||||
	return entNo;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
@@ -450,7 +450,7 @@ AddStmtToCache(int lineno,		/* line # of statement		*/
 | 
			
		||||
 | 
			
		||||
/* 'entNo' is the entry to use - make sure its free										*/
 | 
			
		||||
	if (ecpg_freeStmtCacheEntry(lineno, compat, entNo) < 0)
 | 
			
		||||
		return (-1);
 | 
			
		||||
		return -1;
 | 
			
		||||
 | 
			
		||||
/* add the query to the entry															*/
 | 
			
		||||
	entry = &stmtCacheEntries[entNo];
 | 
			
		||||
@@ -460,7 +460,7 @@ AddStmtToCache(int lineno,		/* line # of statement		*/
 | 
			
		||||
	entry->execs = 0;
 | 
			
		||||
	memcpy(entry->stmtID, stmtID, sizeof(entry->stmtID));
 | 
			
		||||
 | 
			
		||||
	return (entNo);
 | 
			
		||||
	return entNo;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* handle cache and preparation of statements in auto-prepare mode */
 | 
			
		||||
@@ -487,7 +487,7 @@ ecpg_auto_prepare(int lineno, const char *connection_name, const int compat, cha
 | 
			
		||||
		prep = ecpg_find_prepared_statement(stmtID, con, NULL);
 | 
			
		||||
		/* This prepared name doesn't exist on this connection. */
 | 
			
		||||
		if (!prep && !prepare_common(lineno, con, stmtID, query))
 | 
			
		||||
			return (false);
 | 
			
		||||
			return false;
 | 
			
		||||
 | 
			
		||||
		*name = ecpg_strdup(stmtID, lineno);
 | 
			
		||||
	}
 | 
			
		||||
@@ -501,9 +501,9 @@ ecpg_auto_prepare(int lineno, const char *connection_name, const int compat, cha
 | 
			
		||||
		sprintf(stmtID, "ecpg%d", nextStmtID++);
 | 
			
		||||
 | 
			
		||||
		if (!ECPGprepare(lineno, connection_name, 0, stmtID, query))
 | 
			
		||||
			return (false);
 | 
			
		||||
			return false;
 | 
			
		||||
		if (AddStmtToCache(lineno, stmtID, connection_name, compat, query) < 0)
 | 
			
		||||
			return (false);
 | 
			
		||||
			return false;
 | 
			
		||||
 | 
			
		||||
		*name = ecpg_strdup(stmtID, lineno);
 | 
			
		||||
	}
 | 
			
		||||
@@ -511,5 +511,5 @@ ecpg_auto_prepare(int lineno, const char *connection_name, const int compat, cha
 | 
			
		||||
	/* increase usage counter */
 | 
			
		||||
	stmtCacheEntries[entNo].execs++;
 | 
			
		||||
 | 
			
		||||
	return (true);
 | 
			
		||||
	return true;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -12,7 +12,7 @@ pgtypes_alloc(long size)
 | 
			
		||||
 | 
			
		||||
	if (!new)
 | 
			
		||||
		errno = ENOMEM;
 | 
			
		||||
	return (new);
 | 
			
		||||
	return new;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
char *
 | 
			
		||||
@@ -22,7 +22,7 @@ pgtypes_strdup(const char *str)
 | 
			
		||||
 | 
			
		||||
	if (!new)
 | 
			
		||||
		errno = ENOMEM;
 | 
			
		||||
	return (new);
 | 
			
		||||
	return new;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int
 | 
			
		||||
 
 | 
			
		||||
@@ -40,7 +40,7 @@ apply_typmod(numeric *var, long typmod)
 | 
			
		||||
 | 
			
		||||
	/* Do nothing if we have a default typmod (-1) */
 | 
			
		||||
	if (typmod < (long) (VARHDRSZ))
 | 
			
		||||
		return (0);
 | 
			
		||||
		return 0;
 | 
			
		||||
 | 
			
		||||
	typmod -= VARHDRSZ;
 | 
			
		||||
	precision = (typmod >> 16) & 0xffff;
 | 
			
		||||
@@ -100,7 +100,7 @@ apply_typmod(numeric *var, long typmod)
 | 
			
		||||
 | 
			
		||||
	var->rscale = scale;
 | 
			
		||||
	var->dscale = scale;
 | 
			
		||||
	return (0);
 | 
			
		||||
	return 0;
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
@@ -296,7 +296,7 @@ set_var_from_str(char *str, char **ptr, numeric *dest)
 | 
			
		||||
		dest->weight = 0;
 | 
			
		||||
 | 
			
		||||
	dest->rscale = dest->dscale;
 | 
			
		||||
	return (0);
 | 
			
		||||
	return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@@ -412,16 +412,16 @@ PGTYPESnumeric_from_asc(char *str, char **endptr)
 | 
			
		||||
	char	  **ptr = (endptr != NULL) ? endptr : &realptr;
 | 
			
		||||
 | 
			
		||||
	if (!value)
 | 
			
		||||
		return (NULL);
 | 
			
		||||
		return NULL;
 | 
			
		||||
 | 
			
		||||
	ret = set_var_from_str(str, ptr, value);
 | 
			
		||||
	if (ret)
 | 
			
		||||
	{
 | 
			
		||||
		PGTYPESnumeric_free(value);
 | 
			
		||||
		return (NULL);
 | 
			
		||||
		return NULL;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return (value);
 | 
			
		||||
	return value;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
char *
 | 
			
		||||
@@ -445,7 +445,7 @@ PGTYPESnumeric_to_asc(numeric *num, int dscale)
 | 
			
		||||
	/* get_str_from_var may change its argument */
 | 
			
		||||
	s = get_str_from_var(numcopy, dscale);
 | 
			
		||||
	PGTYPESnumeric_free(numcopy);
 | 
			
		||||
	return (s);
 | 
			
		||||
	return s;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* ----------
 | 
			
		||||
 
 | 
			
		||||
@@ -224,14 +224,14 @@ PGTYPEStimestamp_from_asc(char *str, char **endptr)
 | 
			
		||||
	if (strlen(str) > MAXDATELEN)
 | 
			
		||||
	{
 | 
			
		||||
		errno = PGTYPES_TS_BAD_TIMESTAMP;
 | 
			
		||||
		return (noresult);
 | 
			
		||||
		return noresult;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if (ParseDateTime(str, lowstr, field, ftype, &nf, ptr) != 0 ||
 | 
			
		||||
		DecodeDateTime(field, ftype, nf, &dtype, tm, &fsec, 0) != 0)
 | 
			
		||||
	{
 | 
			
		||||
		errno = PGTYPES_TS_BAD_TIMESTAMP;
 | 
			
		||||
		return (noresult);
 | 
			
		||||
		return noresult;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	switch (dtype)
 | 
			
		||||
@@ -240,7 +240,7 @@ PGTYPEStimestamp_from_asc(char *str, char **endptr)
 | 
			
		||||
			if (tm2timestamp(tm, fsec, NULL, &result) != 0)
 | 
			
		||||
			{
 | 
			
		||||
				errno = PGTYPES_TS_BAD_TIMESTAMP;
 | 
			
		||||
				return (noresult);
 | 
			
		||||
				return noresult;
 | 
			
		||||
			}
 | 
			
		||||
			break;
 | 
			
		||||
 | 
			
		||||
@@ -258,11 +258,11 @@ PGTYPEStimestamp_from_asc(char *str, char **endptr)
 | 
			
		||||
 | 
			
		||||
		case DTK_INVALID:
 | 
			
		||||
			errno = PGTYPES_TS_BAD_TIMESTAMP;
 | 
			
		||||
			return (noresult);
 | 
			
		||||
			return noresult;
 | 
			
		||||
 | 
			
		||||
		default:
 | 
			
		||||
			errno = PGTYPES_TS_BAD_TIMESTAMP;
 | 
			
		||||
			return (noresult);
 | 
			
		||||
			return noresult;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/* AdjustTimestampForTypmod(&result, typmod); */
 | 
			
		||||
 
 | 
			
		||||
@@ -137,7 +137,7 @@ main(int argc, char *const argv[])
 | 
			
		||||
	if (find_my_exec(argv[0], my_exec_path) < 0)
 | 
			
		||||
	{
 | 
			
		||||
		fprintf(stderr, _("%s: could not locate my own executable path\n"), argv[0]);
 | 
			
		||||
		return (ILLEGAL_OPTION);
 | 
			
		||||
		return ILLEGAL_OPTION;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if (argc > 1)
 | 
			
		||||
@@ -266,7 +266,7 @@ main(int argc, char *const argv[])
 | 
			
		||||
	{
 | 
			
		||||
		fprintf(stderr, _("%s: no input files specified\n"), progname);
 | 
			
		||||
		fprintf(stderr, _("Try \"%s --help\" for more information.\n"), argv[0]);
 | 
			
		||||
		return (ILLEGAL_OPTION);
 | 
			
		||||
		return ILLEGAL_OPTION;
 | 
			
		||||
	}
 | 
			
		||||
	else
 | 
			
		||||
	{
 | 
			
		||||
 
 | 
			
		||||
@@ -142,7 +142,7 @@ cat2_str(char *str1, char *str2)
 | 
			
		||||
	strcat(res_str, str2);
 | 
			
		||||
	free(str1);
 | 
			
		||||
	free(str2);
 | 
			
		||||
	return(res_str);
 | 
			
		||||
	return res_str;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static char *
 | 
			
		||||
@@ -162,7 +162,7 @@ cat_str(int count, ...)
 | 
			
		||||
 | 
			
		||||
	va_end(args);
 | 
			
		||||
 | 
			
		||||
	return(res_str);
 | 
			
		||||
	return res_str;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static char *
 | 
			
		||||
@@ -174,7 +174,7 @@ make2_str(char *str1, char *str2)
 | 
			
		||||
	strcat(res_str, str2);
 | 
			
		||||
	free(str1);
 | 
			
		||||
	free(str2);
 | 
			
		||||
	return(res_str);
 | 
			
		||||
	return res_str;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static char *
 | 
			
		||||
@@ -188,7 +188,7 @@ make3_str(char *str1, char *str2, char *str3)
 | 
			
		||||
	free(str1);
 | 
			
		||||
	free(str2);
 | 
			
		||||
	free(str3);
 | 
			
		||||
	return(res_str);
 | 
			
		||||
	return res_str;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* and the rest */
 | 
			
		||||
@@ -233,7 +233,7 @@ create_questionmarks(char *name, bool array)
 | 
			
		||||
	/* removed the trailing " ," */
 | 
			
		||||
 | 
			
		||||
	result[strlen(result)-3] = '\0';
 | 
			
		||||
	return(result);
 | 
			
		||||
	return result;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static char *
 | 
			
		||||
 
 | 
			
		||||
@@ -768,7 +768,7 @@ cppline			{space}*#([^i][A-Za-z]*|{if}|{ifdef}|{ifndef}|{import})((\/\*[^*/]*\*+
 | 
			
		||||
					}
 | 
			
		||||
<SQL>:{identifier}((("->"|\.){identifier})|(\[{array}\]))*	{
 | 
			
		||||
						base_yylval.str = mm_strdup(yytext+1);
 | 
			
		||||
						return(CVARIABLE);
 | 
			
		||||
						return CVARIABLE;
 | 
			
		||||
					}
 | 
			
		||||
<SQL>{identifier}	{
 | 
			
		||||
						const ScanKeyword  *keyword;
 | 
			
		||||
@@ -832,7 +832,7 @@ cppline			{space}*#([^i][A-Za-z]*|{if}|{ifdef}|{ifndef}|{import})((\/\*[^*/]*\*+
 | 
			
		||||
						else
 | 
			
		||||
						{
 | 
			
		||||
							base_yylval.str = mm_strdup(yytext);
 | 
			
		||||
							return(CPP_LINE);
 | 
			
		||||
							return CPP_LINE;
 | 
			
		||||
						}
 | 
			
		||||
					}
 | 
			
		||||
<C>{cppinclude_next}		{
 | 
			
		||||
@@ -844,12 +844,12 @@ cppline			{space}*#([^i][A-Za-z]*|{if}|{ifdef}|{ifndef}|{import})((\/\*[^*/]*\*+
 | 
			
		||||
						else
 | 
			
		||||
						{
 | 
			
		||||
							base_yylval.str = mm_strdup(yytext);
 | 
			
		||||
							return(CPP_LINE);
 | 
			
		||||
							return CPP_LINE;
 | 
			
		||||
						}
 | 
			
		||||
					}
 | 
			
		||||
<C,SQL>{cppline}	{
 | 
			
		||||
						base_yylval.str = mm_strdup(yytext);
 | 
			
		||||
						return(CPP_LINE);
 | 
			
		||||
						return CPP_LINE;
 | 
			
		||||
					}
 | 
			
		||||
<C>{identifier}		{
 | 
			
		||||
						const ScanKeyword		*keyword;
 | 
			
		||||
@@ -879,38 +879,38 @@ cppline			{space}*#([^i][A-Za-z]*|{if}|{ifdef}|{ifndef}|{import})((\/\*[^*/]*\*+
 | 
			
		||||
						}
 | 
			
		||||
					}
 | 
			
		||||
<C>{xcstop}			{ mmerror(PARSE_ERROR, ET_ERROR, "nested /* ... */ comments"); }
 | 
			
		||||
<C>":"				{ return(':'); }
 | 
			
		||||
<C>";"				{ return(';'); }
 | 
			
		||||
<C>","				{ return(','); }
 | 
			
		||||
<C>"*"				{ return('*'); }
 | 
			
		||||
<C>"%"				{ return('%'); }
 | 
			
		||||
<C>"/"				{ return('/'); }
 | 
			
		||||
<C>"+"				{ return('+'); }
 | 
			
		||||
<C>"-"				{ return('-'); }
 | 
			
		||||
<C>"("				{ parenths_open++; return('('); }
 | 
			
		||||
<C>")"				{ parenths_open--; return(')'); }
 | 
			
		||||
<C>":"				{ return ':'; }
 | 
			
		||||
<C>";"				{ return ';'; }
 | 
			
		||||
<C>","				{ return ','; }
 | 
			
		||||
<C>"*"				{ return '*'; }
 | 
			
		||||
<C>"%"				{ return '%'; }
 | 
			
		||||
<C>"/"				{ return '/'; }
 | 
			
		||||
<C>"+"				{ return '+'; }
 | 
			
		||||
<C>"-"				{ return '-'; }
 | 
			
		||||
<C>"("				{ parenths_open++; return '('; }
 | 
			
		||||
<C>")"				{ parenths_open--; return ')'; }
 | 
			
		||||
<C,xskip>{space}		{ ECHO; }
 | 
			
		||||
<C>\{				{ return('{'); }
 | 
			
		||||
<C>\}				{ return('}'); }
 | 
			
		||||
<C>\[				{ return('['); }
 | 
			
		||||
<C>\]				{ return(']'); }
 | 
			
		||||
<C>\=				{ return('='); }
 | 
			
		||||
<C>"->"				{ return(S_MEMBER); }
 | 
			
		||||
<C>">>"				{ return(S_RSHIFT); }
 | 
			
		||||
<C>"<<"				{ return(S_LSHIFT); }
 | 
			
		||||
<C>"||"				{ return(S_OR); }
 | 
			
		||||
<C>"&&"				{ return(S_AND); }
 | 
			
		||||
<C>"++"				{ return(S_INC); }
 | 
			
		||||
<C>"--"				{ return(S_DEC); }
 | 
			
		||||
<C>"=="				{ return(S_EQUAL); }
 | 
			
		||||
<C>"!="				{ return(S_NEQUAL); }
 | 
			
		||||
<C>"+="				{ return(S_ADD); }
 | 
			
		||||
<C>"-="				{ return(S_SUB); }
 | 
			
		||||
<C>"*="				{ return(S_MUL); }
 | 
			
		||||
<C>"/="				{ return(S_DIV); }
 | 
			
		||||
<C>"%="				{ return(S_MOD); }
 | 
			
		||||
<C>"->*"			{ return(S_MEMPOINT); }
 | 
			
		||||
<C>".*"				{ return(S_DOTPOINT); }
 | 
			
		||||
<C>\{				{ return '{'; }
 | 
			
		||||
<C>\}				{ return '}'; }
 | 
			
		||||
<C>\[				{ return '['; }
 | 
			
		||||
<C>\]				{ return ']'; }
 | 
			
		||||
<C>\=				{ return '='; }
 | 
			
		||||
<C>"->"				{ return S_MEMBER; }
 | 
			
		||||
<C>">>"				{ return S_RSHIFT; }
 | 
			
		||||
<C>"<<"				{ return S_LSHIFT; }
 | 
			
		||||
<C>"||"				{ return S_OR; }
 | 
			
		||||
<C>"&&"				{ return S_AND; }
 | 
			
		||||
<C>"++"				{ return S_INC; }
 | 
			
		||||
<C>"--"				{ return S_DEC; }
 | 
			
		||||
<C>"=="				{ return S_EQUAL; }
 | 
			
		||||
<C>"!="				{ return S_NEQUAL; }
 | 
			
		||||
<C>"+="				{ return S_ADD; }
 | 
			
		||||
<C>"-="				{ return S_SUB; }
 | 
			
		||||
<C>"*="				{ return S_MUL; }
 | 
			
		||||
<C>"/="				{ return S_DIV; }
 | 
			
		||||
<C>"%="				{ return S_MOD; }
 | 
			
		||||
<C>"->*"			{ return S_MEMPOINT; }
 | 
			
		||||
<C>".*"				{ return S_DOTPOINT; }
 | 
			
		||||
<C>{other}			{ return S_ANYTHING; }
 | 
			
		||||
<C>{exec_sql}{define}{space}*	{ BEGIN(def_ident); }
 | 
			
		||||
<C>{informix_special}{define}{space}*	{
 | 
			
		||||
@@ -922,7 +922,7 @@ cppline			{space}*#([^i][A-Za-z]*|{if}|{ifdef}|{ifndef}|{import})((\/\*[^*/]*\*+
 | 
			
		||||
						else
 | 
			
		||||
						{
 | 
			
		||||
							yyless(1);
 | 
			
		||||
							return (S_ANYTHING);
 | 
			
		||||
							return S_ANYTHING;
 | 
			
		||||
						}
 | 
			
		||||
					}
 | 
			
		||||
<C>{exec_sql}{undef}{space}*		{ BEGIN(undef); }
 | 
			
		||||
@@ -935,7 +935,7 @@ cppline			{space}*#([^i][A-Za-z]*|{if}|{ifdef}|{ifndef}|{import})((\/\*[^*/]*\*+
 | 
			
		||||
						else
 | 
			
		||||
						{
 | 
			
		||||
							yyless(1);
 | 
			
		||||
							return (S_ANYTHING);
 | 
			
		||||
							return S_ANYTHING;
 | 
			
		||||
						}
 | 
			
		||||
					}
 | 
			
		||||
<undef>{identifier}{space}*";" {
 | 
			
		||||
@@ -984,7 +984,7 @@ cppline			{space}*#([^i][A-Za-z]*|{if}|{ifdef}|{ifndef}|{import})((\/\*[^*/]*\*+
 | 
			
		||||
					  else
 | 
			
		||||
					  {
 | 
			
		||||
						  yyless(1);
 | 
			
		||||
						  return (S_ANYTHING);
 | 
			
		||||
						  return S_ANYTHING;
 | 
			
		||||
					  }
 | 
			
		||||
					}
 | 
			
		||||
<C,xskip>{exec_sql}{ifdef}{space}*	{ ifcond = TRUE; BEGIN(xcond); }
 | 
			
		||||
@@ -998,7 +998,7 @@ cppline			{space}*#([^i][A-Za-z]*|{if}|{ifdef}|{ifndef}|{import})((\/\*[^*/]*\*+
 | 
			
		||||
					  else
 | 
			
		||||
					  {
 | 
			
		||||
						  yyless(1);
 | 
			
		||||
						  return (S_ANYTHING);
 | 
			
		||||
						  return S_ANYTHING;
 | 
			
		||||
					  }
 | 
			
		||||
					}
 | 
			
		||||
<C,xskip>{exec_sql}{ifndef}{space}* { ifcond = FALSE; BEGIN(xcond); }
 | 
			
		||||
@@ -1012,7 +1012,7 @@ cppline			{space}*#([^i][A-Za-z]*|{if}|{ifdef}|{ifndef}|{import})((\/\*[^*/]*\*+
 | 
			
		||||
					  else
 | 
			
		||||
					  {
 | 
			
		||||
						  yyless(1);
 | 
			
		||||
						  return (S_ANYTHING);
 | 
			
		||||
						  return S_ANYTHING;
 | 
			
		||||
					  }
 | 
			
		||||
					}
 | 
			
		||||
<C,xskip>{exec_sql}{elif}{space}*	{	/* pop stack */
 | 
			
		||||
@@ -1043,7 +1043,7 @@ cppline			{space}*#([^i][A-Za-z]*|{if}|{ifdef}|{ifndef}|{import})((\/\*[^*/]*\*+
 | 
			
		||||
					else
 | 
			
		||||
					{
 | 
			
		||||
						yyless(1);
 | 
			
		||||
						return (S_ANYTHING);
 | 
			
		||||
						return S_ANYTHING;
 | 
			
		||||
					}
 | 
			
		||||
				}
 | 
			
		||||
 | 
			
		||||
@@ -1085,7 +1085,7 @@ cppline			{space}*#([^i][A-Za-z]*|{if}|{ifdef}|{ifndef}|{import})((\/\*[^*/]*\*+
 | 
			
		||||
					else
 | 
			
		||||
					{
 | 
			
		||||
						yyless(1);
 | 
			
		||||
						return (S_ANYTHING);
 | 
			
		||||
						return S_ANYTHING;
 | 
			
		||||
					}
 | 
			
		||||
				}
 | 
			
		||||
<C,xskip>{exec_sql}{endif}{space}*";" {
 | 
			
		||||
@@ -1116,7 +1116,7 @@ cppline			{space}*#([^i][A-Za-z]*|{if}|{ifdef}|{ifndef}|{import})((\/\*[^*/]*\*+
 | 
			
		||||
					else
 | 
			
		||||
					{
 | 
			
		||||
						yyless(1);
 | 
			
		||||
						return (S_ANYTHING);
 | 
			
		||||
						return S_ANYTHING;
 | 
			
		||||
					}
 | 
			
		||||
				}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -69,7 +69,7 @@ ECPGstruct_member_dup(struct ECPGstruct_member *rm)
 | 
			
		||||
		rm = rm->next;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return (new);
 | 
			
		||||
	return new;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* The NAME argument is copied. The type argument is preserved as a pointer. */
 | 
			
		||||
@@ -135,78 +135,78 @@ get_type(enum ECPGttype type)
 | 
			
		||||
	switch (type)
 | 
			
		||||
	{
 | 
			
		||||
		case ECPGt_char:
 | 
			
		||||
			return ("ECPGt_char");
 | 
			
		||||
			return "ECPGt_char";
 | 
			
		||||
			break;
 | 
			
		||||
		case ECPGt_unsigned_char:
 | 
			
		||||
			return ("ECPGt_unsigned_char");
 | 
			
		||||
			return "ECPGt_unsigned_char";
 | 
			
		||||
			break;
 | 
			
		||||
		case ECPGt_short:
 | 
			
		||||
			return ("ECPGt_short");
 | 
			
		||||
			return "ECPGt_short";
 | 
			
		||||
			break;
 | 
			
		||||
		case ECPGt_unsigned_short:
 | 
			
		||||
			return ("ECPGt_unsigned_short");
 | 
			
		||||
			return "ECPGt_unsigned_short";
 | 
			
		||||
			break;
 | 
			
		||||
		case ECPGt_int:
 | 
			
		||||
			return ("ECPGt_int");
 | 
			
		||||
			return "ECPGt_int";
 | 
			
		||||
			break;
 | 
			
		||||
		case ECPGt_unsigned_int:
 | 
			
		||||
			return ("ECPGt_unsigned_int");
 | 
			
		||||
			return "ECPGt_unsigned_int";
 | 
			
		||||
			break;
 | 
			
		||||
		case ECPGt_long:
 | 
			
		||||
			return ("ECPGt_long");
 | 
			
		||||
			return "ECPGt_long";
 | 
			
		||||
			break;
 | 
			
		||||
		case ECPGt_unsigned_long:
 | 
			
		||||
			return ("ECPGt_unsigned_long");
 | 
			
		||||
			return "ECPGt_unsigned_long";
 | 
			
		||||
			break;
 | 
			
		||||
		case ECPGt_long_long:
 | 
			
		||||
			return ("ECPGt_long_long");
 | 
			
		||||
			return "ECPGt_long_long";
 | 
			
		||||
			break;
 | 
			
		||||
		case ECPGt_unsigned_long_long:
 | 
			
		||||
			return ("ECPGt_unsigned_long_long");
 | 
			
		||||
			return "ECPGt_unsigned_long_long";
 | 
			
		||||
			break;
 | 
			
		||||
		case ECPGt_float:
 | 
			
		||||
			return ("ECPGt_float");
 | 
			
		||||
			return "ECPGt_float";
 | 
			
		||||
			break;
 | 
			
		||||
		case ECPGt_double:
 | 
			
		||||
			return ("ECPGt_double");
 | 
			
		||||
			return "ECPGt_double";
 | 
			
		||||
			break;
 | 
			
		||||
		case ECPGt_bool:
 | 
			
		||||
			return ("ECPGt_bool");
 | 
			
		||||
			return "ECPGt_bool";
 | 
			
		||||
			break;
 | 
			
		||||
		case ECPGt_varchar:
 | 
			
		||||
			return ("ECPGt_varchar");
 | 
			
		||||
			return "ECPGt_varchar";
 | 
			
		||||
		case ECPGt_NO_INDICATOR:	/* no indicator */
 | 
			
		||||
			return ("ECPGt_NO_INDICATOR");
 | 
			
		||||
			return "ECPGt_NO_INDICATOR";
 | 
			
		||||
			break;
 | 
			
		||||
		case ECPGt_char_variable:	/* string that should not be quoted */
 | 
			
		||||
			return ("ECPGt_char_variable");
 | 
			
		||||
			return "ECPGt_char_variable";
 | 
			
		||||
			break;
 | 
			
		||||
		case ECPGt_const:		/* constant string quoted */
 | 
			
		||||
			return ("ECPGt_const");
 | 
			
		||||
			return "ECPGt_const";
 | 
			
		||||
			break;
 | 
			
		||||
		case ECPGt_decimal:
 | 
			
		||||
			return ("ECPGt_decimal");
 | 
			
		||||
			return "ECPGt_decimal";
 | 
			
		||||
			break;
 | 
			
		||||
		case ECPGt_numeric:
 | 
			
		||||
			return ("ECPGt_numeric");
 | 
			
		||||
			return "ECPGt_numeric";
 | 
			
		||||
			break;
 | 
			
		||||
		case ECPGt_interval:
 | 
			
		||||
			return ("ECPGt_interval");
 | 
			
		||||
			return "ECPGt_interval";
 | 
			
		||||
			break;
 | 
			
		||||
		case ECPGt_descriptor:
 | 
			
		||||
			return ("ECPGt_descriptor");
 | 
			
		||||
			return "ECPGt_descriptor";
 | 
			
		||||
			break;
 | 
			
		||||
		case ECPGt_sqlda:
 | 
			
		||||
			return ("ECPGt_sqlda");
 | 
			
		||||
			return "ECPGt_sqlda";
 | 
			
		||||
			break;
 | 
			
		||||
		case ECPGt_date:
 | 
			
		||||
			return ("ECPGt_date");
 | 
			
		||||
			return "ECPGt_date";
 | 
			
		||||
			break;
 | 
			
		||||
		case ECPGt_timestamp:
 | 
			
		||||
			return ("ECPGt_timestamp");
 | 
			
		||||
			return "ECPGt_timestamp";
 | 
			
		||||
			break;
 | 
			
		||||
		case ECPGt_string:
 | 
			
		||||
			return ("ECPGt_string");
 | 
			
		||||
			return "ECPGt_string";
 | 
			
		||||
			break;
 | 
			
		||||
		default:
 | 
			
		||||
			mmerror(PARSE_ERROR, ET_ERROR, "unrecognized variable type code %d", type);
 | 
			
		||||
@@ -674,51 +674,51 @@ get_dtype(enum ECPGdtype type)
 | 
			
		||||
	switch (type)
 | 
			
		||||
	{
 | 
			
		||||
		case ECPGd_count:
 | 
			
		||||
			return ("ECPGd_countr");
 | 
			
		||||
			return "ECPGd_countr";
 | 
			
		||||
			break;
 | 
			
		||||
		case ECPGd_data:
 | 
			
		||||
			return ("ECPGd_data");
 | 
			
		||||
			return "ECPGd_data";
 | 
			
		||||
			break;
 | 
			
		||||
		case ECPGd_di_code:
 | 
			
		||||
			return ("ECPGd_di_code");
 | 
			
		||||
			return "ECPGd_di_code";
 | 
			
		||||
			break;
 | 
			
		||||
		case ECPGd_di_precision:
 | 
			
		||||
			return ("ECPGd_di_precision");
 | 
			
		||||
			return "ECPGd_di_precision";
 | 
			
		||||
			break;
 | 
			
		||||
		case ECPGd_indicator:
 | 
			
		||||
			return ("ECPGd_indicator");
 | 
			
		||||
			return "ECPGd_indicator";
 | 
			
		||||
			break;
 | 
			
		||||
		case ECPGd_key_member:
 | 
			
		||||
			return ("ECPGd_key_member");
 | 
			
		||||
			return "ECPGd_key_member";
 | 
			
		||||
			break;
 | 
			
		||||
		case ECPGd_length:
 | 
			
		||||
			return ("ECPGd_length");
 | 
			
		||||
			return "ECPGd_length";
 | 
			
		||||
			break;
 | 
			
		||||
		case ECPGd_name:
 | 
			
		||||
			return ("ECPGd_name");
 | 
			
		||||
			return "ECPGd_name";
 | 
			
		||||
			break;
 | 
			
		||||
		case ECPGd_nullable:
 | 
			
		||||
			return ("ECPGd_nullable");
 | 
			
		||||
			return "ECPGd_nullable";
 | 
			
		||||
			break;
 | 
			
		||||
		case ECPGd_octet:
 | 
			
		||||
			return ("ECPGd_octet");
 | 
			
		||||
			return "ECPGd_octet";
 | 
			
		||||
			break;
 | 
			
		||||
		case ECPGd_precision:
 | 
			
		||||
			return ("ECPGd_precision");
 | 
			
		||||
			return "ECPGd_precision";
 | 
			
		||||
			break;
 | 
			
		||||
		case ECPGd_ret_length:
 | 
			
		||||
			return ("ECPGd_ret_length");
 | 
			
		||||
			return "ECPGd_ret_length";
 | 
			
		||||
		case ECPGd_ret_octet:
 | 
			
		||||
			return ("ECPGd_ret_octet");
 | 
			
		||||
			return "ECPGd_ret_octet";
 | 
			
		||||
			break;
 | 
			
		||||
		case ECPGd_scale:
 | 
			
		||||
			return ("ECPGd_scale");
 | 
			
		||||
			return "ECPGd_scale";
 | 
			
		||||
			break;
 | 
			
		||||
		case ECPGd_type:
 | 
			
		||||
			return ("ECPGd_type");
 | 
			
		||||
			return "ECPGd_type";
 | 
			
		||||
			break;
 | 
			
		||||
		case ECPGd_cardinality:
 | 
			
		||||
			return ("ECPGd_cardinality");
 | 
			
		||||
			return "ECPGd_cardinality";
 | 
			
		||||
		default:
 | 
			
		||||
			mmerror(PARSE_ERROR, ET_ERROR, "unrecognized descriptor item code %d", type);
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
@@ -18,7 +18,7 @@ new_variable(const char *name, struct ECPGtype *type, int brace_level)
 | 
			
		||||
	p->next = allvariables;
 | 
			
		||||
	allvariables = p;
 | 
			
		||||
 | 
			
		||||
	return (p);
 | 
			
		||||
	return p;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static struct variable *
 | 
			
		||||
@@ -44,12 +44,12 @@ find_struct_member(char *name, char *str, struct ECPGstruct_member *members, int
 | 
			
		||||
				switch (members->type->type)
 | 
			
		||||
				{
 | 
			
		||||
					case ECPGt_array:
 | 
			
		||||
						return (new_variable(name, ECPGmake_array_type(ECPGmake_simple_type(members->type->u.element->type, members->type->u.element->size, members->type->u.element->counter), members->type->size), brace_level));
 | 
			
		||||
						return new_variable(name, ECPGmake_array_type(ECPGmake_simple_type(members->type->u.element->type, members->type->u.element->size, members->type->u.element->counter), members->type->size), brace_level);
 | 
			
		||||
					case ECPGt_struct:
 | 
			
		||||
					case ECPGt_union:
 | 
			
		||||
						return (new_variable(name, ECPGmake_struct_type(members->type->u.members, members->type->type, members->type->type_name, members->type->struct_sizeof), brace_level));
 | 
			
		||||
						return new_variable(name, ECPGmake_struct_type(members->type->u.members, members->type->type, members->type->type_name, members->type->struct_sizeof), brace_level);
 | 
			
		||||
					default:
 | 
			
		||||
						return (new_variable(name, ECPGmake_simple_type(members->type->type, members->type->size, members->type->counter), brace_level));
 | 
			
		||||
						return new_variable(name, ECPGmake_simple_type(members->type->type, members->type->size, members->type->counter), brace_level);
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
			else
 | 
			
		||||
@@ -91,26 +91,26 @@ find_struct_member(char *name, char *str, struct ECPGstruct_member *members, int
 | 
			
		||||
						switch (members->type->u.element->type)
 | 
			
		||||
						{
 | 
			
		||||
							case ECPGt_array:
 | 
			
		||||
								return (new_variable(name, ECPGmake_array_type(ECPGmake_simple_type(members->type->u.element->u.element->type, members->type->u.element->u.element->size, members->type->u.element->u.element->counter), members->type->u.element->size), brace_level));
 | 
			
		||||
								return new_variable(name, ECPGmake_array_type(ECPGmake_simple_type(members->type->u.element->u.element->type, members->type->u.element->u.element->size, members->type->u.element->u.element->counter), members->type->u.element->size), brace_level);
 | 
			
		||||
							case ECPGt_struct:
 | 
			
		||||
							case ECPGt_union:
 | 
			
		||||
								return (new_variable(name, ECPGmake_struct_type(members->type->u.element->u.members, members->type->u.element->type, members->type->u.element->type_name, members->type->u.element->struct_sizeof), brace_level));
 | 
			
		||||
								return new_variable(name, ECPGmake_struct_type(members->type->u.element->u.members, members->type->u.element->type, members->type->u.element->type_name, members->type->u.element->struct_sizeof), brace_level);
 | 
			
		||||
							default:
 | 
			
		||||
								return (new_variable(name, ECPGmake_simple_type(members->type->u.element->type, members->type->u.element->size, members->type->u.element->counter), brace_level));
 | 
			
		||||
								return new_variable(name, ECPGmake_simple_type(members->type->u.element->type, members->type->u.element->size, members->type->u.element->counter), brace_level);
 | 
			
		||||
						}
 | 
			
		||||
						break;
 | 
			
		||||
					case '-':
 | 
			
		||||
						if (members->type->type == ECPGt_array)
 | 
			
		||||
							return (find_struct_member(name, ++end, members->type->u.element->u.members, brace_level));
 | 
			
		||||
							return find_struct_member(name, ++end, members->type->u.element->u.members, brace_level);
 | 
			
		||||
						else
 | 
			
		||||
							return (find_struct_member(name, ++end, members->type->u.members, brace_level));
 | 
			
		||||
							return find_struct_member(name, ++end, members->type->u.members, brace_level);
 | 
			
		||||
						break;
 | 
			
		||||
						break;
 | 
			
		||||
					case '.':
 | 
			
		||||
						if (members->type->type == ECPGt_array)
 | 
			
		||||
							return (find_struct_member(name, end, members->type->u.element->u.members, brace_level));
 | 
			
		||||
							return find_struct_member(name, end, members->type->u.element->u.members, brace_level);
 | 
			
		||||
						else
 | 
			
		||||
							return (find_struct_member(name, end, members->type->u.members, brace_level));
 | 
			
		||||
							return find_struct_member(name, end, members->type->u.members, brace_level);
 | 
			
		||||
						break;
 | 
			
		||||
					default:
 | 
			
		||||
						mmfatal(PARSE_ERROR, "incorrectly formed variable \"%s\"", name);
 | 
			
		||||
@@ -120,7 +120,7 @@ find_struct_member(char *name, char *str, struct ECPGstruct_member *members, int
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return (NULL);
 | 
			
		||||
	return NULL;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static struct variable *
 | 
			
		||||
@@ -185,7 +185,7 @@ find_simple(char *name)
 | 
			
		||||
			return p;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return (NULL);
 | 
			
		||||
	return NULL;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* Note that this function will end the program in case of an unknown */
 | 
			
		||||
@@ -236,12 +236,12 @@ find_variable(char *name)
 | 
			
		||||
				switch (p->type->u.element->type)
 | 
			
		||||
				{
 | 
			
		||||
					case ECPGt_array:
 | 
			
		||||
						return (new_variable(name, ECPGmake_array_type(ECPGmake_simple_type(p->type->u.element->u.element->type, p->type->u.element->u.element->size, p->type->u.element->u.element->counter), p->type->u.element->size), p->brace_level));
 | 
			
		||||
						return new_variable(name, ECPGmake_array_type(ECPGmake_simple_type(p->type->u.element->u.element->type, p->type->u.element->u.element->size, p->type->u.element->u.element->counter), p->type->u.element->size), p->brace_level);
 | 
			
		||||
					case ECPGt_struct:
 | 
			
		||||
					case ECPGt_union:
 | 
			
		||||
						return (new_variable(name, ECPGmake_struct_type(p->type->u.element->u.members, p->type->u.element->type, p->type->u.element->type_name, p->type->u.element->struct_sizeof), p->brace_level));
 | 
			
		||||
						return new_variable(name, ECPGmake_struct_type(p->type->u.element->u.members, p->type->u.element->type, p->type->u.element->type_name, p->type->u.element->struct_sizeof), p->brace_level);
 | 
			
		||||
					default:
 | 
			
		||||
						return (new_variable(name, ECPGmake_simple_type(p->type->u.element->type, p->type->u.element->size, p->type->u.element->counter), p->brace_level));
 | 
			
		||||
						return new_variable(name, ECPGmake_simple_type(p->type->u.element->type, p->type->u.element->size, p->type->u.element->counter), p->brace_level);
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
@@ -254,7 +254,7 @@ find_variable(char *name)
 | 
			
		||||
	if (p == NULL)
 | 
			
		||||
		mmfatal(PARSE_ERROR, "variable \"%s\" is not declared", name);
 | 
			
		||||
 | 
			
		||||
	return (p);
 | 
			
		||||
	return p;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
@@ -505,7 +505,7 @@ get_typedef(char *name)
 | 
			
		||||
	if (!this)
 | 
			
		||||
		mmfatal(PARSE_ERROR, "unrecognized data type name \"%s\"", name);
 | 
			
		||||
 | 
			
		||||
	return (this);
 | 
			
		||||
	return this;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
 
 | 
			
		||||
@@ -206,7 +206,7 @@ main(void)
 | 
			
		||||
	}
 | 
			
		||||
	free(decarr);
 | 
			
		||||
 | 
			
		||||
	return (0);
 | 
			
		||||
	return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
 
 | 
			
		||||
@@ -195,5 +195,5 @@ exec sql end declare section;
 | 
			
		||||
	strcpy(msg, "disconnect");
 | 
			
		||||
	exec sql disconnect;
 | 
			
		||||
 | 
			
		||||
	return (0);
 | 
			
		||||
	return 0;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -147,7 +147,7 @@ main(void)
 | 
			
		||||
	/* ECPG_INFORMIX_BAD_YEAR */
 | 
			
		||||
	/* ??? */
 | 
			
		||||
 | 
			
		||||
	return (0);
 | 
			
		||||
	return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
 
 | 
			
		||||
@@ -45,7 +45,7 @@ main(void)
 | 
			
		||||
	fmtlong(-8494493, "abc: ################+-+");
 | 
			
		||||
	fmtlong(-8494493, "+<<<<,<<<,<<<,<<<");
 | 
			
		||||
 | 
			
		||||
	return (0);
 | 
			
		||||
	return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
 
 | 
			
		||||
@@ -246,5 +246,5 @@ exec sql end declare section;
 | 
			
		||||
	strcpy(msg, "disconnect");
 | 
			
		||||
	exec sql disconnect;
 | 
			
		||||
 | 
			
		||||
	return (0);
 | 
			
		||||
	return 0;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -61,5 +61,5 @@ exec sql end declare section;
 | 
			
		||||
	exec sql connect to unix:postgresql://localhost/ecpg2_regression user regress_ecpg_user1 identified by "wrongpw";
 | 
			
		||||
	/* no disconnect necessary */
 | 
			
		||||
 | 
			
		||||
	return (0);
 | 
			
		||||
	return 0;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -42,5 +42,5 @@ exec sql end declare section;
 | 
			
		||||
	/* disconnect from "second" */
 | 
			
		||||
	exec sql disconnect;
 | 
			
		||||
 | 
			
		||||
	return (0);
 | 
			
		||||
	return 0;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -48,5 +48,5 @@ exec sql end declare section;
 | 
			
		||||
	 *     are used in other tests
 | 
			
		||||
	 */
 | 
			
		||||
 | 
			
		||||
	return (0);
 | 
			
		||||
	return 0;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -16,5 +16,5 @@ main(void)
 | 
			
		||||
 | 
			
		||||
	exec sql disconnect DEFAULT;
 | 
			
		||||
 | 
			
		||||
	return (0);
 | 
			
		||||
	return 0;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -72,5 +72,5 @@ exec sql end declare section;
 | 
			
		||||
	/* not connected */
 | 
			
		||||
	exec sql disconnect nonexistant;
 | 
			
		||||
 | 
			
		||||
	return (0);
 | 
			
		||||
	return 0;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -226,7 +226,7 @@ main(void)
 | 
			
		||||
	}
 | 
			
		||||
	free(decarr);
 | 
			
		||||
 | 
			
		||||
	return (0);
 | 
			
		||||
	return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
 
 | 
			
		||||
@@ -463,5 +463,5 @@ if (sqlca.sqlcode < 0) exit (1);}
 | 
			
		||||
#line 196 "describe.pgc"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
	return (0);
 | 
			
		||||
	return 0;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -158,7 +158,7 @@ main(void)
 | 
			
		||||
	/* ECPG_INFORMIX_BAD_YEAR */
 | 
			
		||||
	/* ??? */
 | 
			
		||||
 | 
			
		||||
	return (0);
 | 
			
		||||
	return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
 
 | 
			
		||||
@@ -56,7 +56,7 @@ main(void)
 | 
			
		||||
	fmtlong(-8494493, "abc: ################+-+");
 | 
			
		||||
	fmtlong(-8494493, "+<<<<,<<<,<<<,<<<");
 | 
			
		||||
 | 
			
		||||
	return (0);
 | 
			
		||||
	return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
 
 | 
			
		||||
@@ -526,5 +526,5 @@ if (sqlca.sqlcode < 0) exit (1);}
 | 
			
		||||
#line 247 "sqlda.pgc"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
	return (0);
 | 
			
		||||
	return 0;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -120,5 +120,5 @@ main(void)
 | 
			
		||||
 | 
			
		||||
	/* no disconnect necessary */
 | 
			
		||||
 | 
			
		||||
	return (0);
 | 
			
		||||
	return 0;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -100,5 +100,5 @@ main(void)
 | 
			
		||||
#line 43 "test2.pgc"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
	return (0);
 | 
			
		||||
	return 0;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -102,5 +102,5 @@ main(void)
 | 
			
		||||
	 *     are used in other tests
 | 
			
		||||
	 */
 | 
			
		||||
 | 
			
		||||
	return (0);
 | 
			
		||||
	return 0;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -40,5 +40,5 @@ main(void)
 | 
			
		||||
#line 17 "test4.pgc"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
	return (0);
 | 
			
		||||
	return 0;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -158,5 +158,5 @@ main(void)
 | 
			
		||||
#line 73 "test5.pgc"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
	return (0);
 | 
			
		||||
	return 0;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -449,5 +449,5 @@ if (sqlca.sqlcode < 0) sqlprint ( );}
 | 
			
		||||
#line 366 "dt_test.pgc"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
	return (0);
 | 
			
		||||
	return 0;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -182,5 +182,5 @@ main(void)
 | 
			
		||||
		PGTYPESinterval_free(i1);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return (0);
 | 
			
		||||
	return 0;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -269,5 +269,5 @@ if (sqlca.sqlcode < 0) sqlprint ( );}
 | 
			
		||||
#line 91 "nan_test.pgc"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
	return (0);
 | 
			
		||||
	return 0;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -157,5 +157,5 @@ if (sqlca.sqlcode < 0) sqlprint ( );}
 | 
			
		||||
#line 94 "num_test.pgc"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
	return (0);
 | 
			
		||||
	return 0;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -228,7 +228,7 @@ main(void)
 | 
			
		||||
	}
 | 
			
		||||
	free(numarr);
 | 
			
		||||
 | 
			
		||||
	return (0);
 | 
			
		||||
	return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
 
 | 
			
		||||
@@ -284,5 +284,5 @@ if (sqlca.sqlcode < 0) sqlprint();}
 | 
			
		||||
#line 92 "array_of_struct.pgc"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    return( 0 );
 | 
			
		||||
    return 0;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -830,5 +830,5 @@ if (sqlca.sqlcode < 0) exit (1);}
 | 
			
		||||
#line 253 "cursor.pgc"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
	return (0);
 | 
			
		||||
	return 0;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -164,5 +164,5 @@ if (sqlca.sqlcode < 0) sqlprint();}
 | 
			
		||||
#line 59 "define.pgc"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
	return (0);
 | 
			
		||||
	return 0;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -477,5 +477,5 @@ if (sqlca.sqlcode < 0) exit (1);}
 | 
			
		||||
#line 144 "describe.pgc"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
	return (0);
 | 
			
		||||
	return 0;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -374,5 +374,5 @@ if (sqlca.sqlcode < 0) exit (1);}
 | 
			
		||||
#line 124 "outofscope.pgc"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
	return (0);
 | 
			
		||||
	return 0;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -289,5 +289,5 @@ if (sqlca.sqlcode < 0) sqlprint();}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
	/* All the memory will anyway be freed at the end */
 | 
			
		||||
    return( 0 );
 | 
			
		||||
    return 0;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -66,5 +66,5 @@ int main(void)
 | 
			
		||||
  { ECPGdisconnect(__LINE__, "CURRENT");}
 | 
			
		||||
#line 25 "strings.pgc"
 | 
			
		||||
 | 
			
		||||
  return (0);
 | 
			
		||||
  return 0;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -272,5 +272,5 @@ if (sqlca.sqlcode < 0) exit (1);}
 | 
			
		||||
#line 98 "variable.pgc"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
	return (0);
 | 
			
		||||
	return 0;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -351,5 +351,5 @@ if (sqlca.sqlcode < 0) sqlprint();}
 | 
			
		||||
 | 
			
		||||
	free(t);
 | 
			
		||||
 | 
			
		||||
	return (0);
 | 
			
		||||
	return 0;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -461,5 +461,5 @@ if (sqlca.sqlcode < 0) exit (1);}
 | 
			
		||||
#line 196 "describe.pgc"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
	return (0);
 | 
			
		||||
	return 0;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -327,5 +327,5 @@ if (sqlca.sqlcode < 0) sqlprint();}
 | 
			
		||||
#line 110 "execute.pgc"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
	return (0);
 | 
			
		||||
	return 0;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -247,5 +247,5 @@ if (sqlca.sqlcode < 0) sqlprint();}
 | 
			
		||||
#line 87 "oldexec.pgc"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
	return (0);
 | 
			
		||||
	return 0;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -527,5 +527,5 @@ if (sqlca.sqlcode < 0) exit (1);}
 | 
			
		||||
#line 247 "sqlda.pgc"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
	return (0);
 | 
			
		||||
	return 0;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -110,5 +110,5 @@ if (sqlca.sqlcode < 0) sqlprint();}
 | 
			
		||||
#line 41 "twophase.pgc"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
	return (0);
 | 
			
		||||
	return 0;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -91,7 +91,7 @@ int main()
 | 
			
		||||
  if( threads == NULL )
 | 
			
		||||
    {
 | 
			
		||||
      fprintf(stderr, "Cannot alloc memory\n");
 | 
			
		||||
      return( 1 );
 | 
			
		||||
      return 1;
 | 
			
		||||
    }
 | 
			
		||||
  for( n = 0; n < nthreads; n++ )
 | 
			
		||||
    {
 | 
			
		||||
@@ -133,7 +133,7 @@ int main()
 | 
			
		||||
  else
 | 
			
		||||
    printf("ERROR: Failure - expecting %d rows, got %d.\n", nthreads * iterations, l_rows);
 | 
			
		||||
 | 
			
		||||
  return( 0 );
 | 
			
		||||
  return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void *test_thread(void *arg)
 | 
			
		||||
@@ -177,7 +177,7 @@ if (sqlca.sqlcode < 0) sqlprint();}
 | 
			
		||||
  if( sqlca.sqlcode != 0 )
 | 
			
		||||
    {
 | 
			
		||||
      printf("%s: ERROR: cannot connect to database!\n", l_connection);
 | 
			
		||||
      return( NULL );
 | 
			
		||||
      return NULL;
 | 
			
		||||
    }
 | 
			
		||||
  { ECPGtrans(__LINE__, l_connection, "begin");
 | 
			
		||||
#line 126 "thread.pgc"
 | 
			
		||||
@@ -216,6 +216,6 @@ if (sqlca.sqlcode < 0) sqlprint();}
 | 
			
		||||
if (sqlca.sqlcode < 0) sqlprint();}
 | 
			
		||||
#line 138 "thread.pgc"
 | 
			
		||||
 | 
			
		||||
  return( NULL );
 | 
			
		||||
  return NULL;
 | 
			
		||||
}
 | 
			
		||||
#endif /* ENABLE_THREAD_SAFETY */
 | 
			
		||||
 
 | 
			
		||||
@@ -92,7 +92,7 @@ int main()
 | 
			
		||||
  if( threads == NULL )
 | 
			
		||||
    {
 | 
			
		||||
      fprintf(stderr, "Cannot alloc memory\n");
 | 
			
		||||
      return( 1 );
 | 
			
		||||
      return 1;
 | 
			
		||||
    }
 | 
			
		||||
  for( n = 0; n < nthreads; n++ )
 | 
			
		||||
    {
 | 
			
		||||
@@ -134,7 +134,7 @@ int main()
 | 
			
		||||
  else
 | 
			
		||||
    printf("ERROR: Failure - expecting %d rows, got %d.\n", nthreads * iterations, l_rows);
 | 
			
		||||
 | 
			
		||||
  return( 0 );
 | 
			
		||||
  return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void *test_thread(void *arg)
 | 
			
		||||
@@ -178,7 +178,7 @@ if (sqlca.sqlcode < 0) sqlprint();}
 | 
			
		||||
  if( sqlca.sqlcode != 0 )
 | 
			
		||||
    {
 | 
			
		||||
      printf("%s: ERROR: cannot connect to database!\n", l_connection);
 | 
			
		||||
      return( NULL );
 | 
			
		||||
      return NULL;
 | 
			
		||||
    }
 | 
			
		||||
  { ECPGtrans(__LINE__, NULL, "begin");
 | 
			
		||||
#line 127 "thread_implicit.pgc"
 | 
			
		||||
@@ -217,6 +217,6 @@ if (sqlca.sqlcode < 0) sqlprint();}
 | 
			
		||||
if (sqlca.sqlcode < 0) sqlprint();}
 | 
			
		||||
#line 139 "thread_implicit.pgc"
 | 
			
		||||
 | 
			
		||||
  return( NULL );
 | 
			
		||||
  return NULL;
 | 
			
		||||
}
 | 
			
		||||
#endif /* ENABLE_THREAD_SAFETY */
 | 
			
		||||
 
 | 
			
		||||
@@ -140,5 +140,5 @@ exec sql end declare section;
 | 
			
		||||
 | 
			
		||||
	exec sql disconnect;
 | 
			
		||||
 | 
			
		||||
	return (0);
 | 
			
		||||
	return 0;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -365,5 +365,5 @@ main(void)
 | 
			
		||||
	exec sql rollback;
 | 
			
		||||
        exec sql disconnect;
 | 
			
		||||
 | 
			
		||||
	return (0);
 | 
			
		||||
	return 0;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -147,5 +147,5 @@ main(void)
 | 
			
		||||
		PGTYPESinterval_free(i1);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return (0);
 | 
			
		||||
	return 0;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -90,5 +90,5 @@ main(void)
 | 
			
		||||
	exec sql rollback;
 | 
			
		||||
	exec sql disconnect;
 | 
			
		||||
 | 
			
		||||
	return (0);
 | 
			
		||||
	return 0;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -93,5 +93,5 @@ main(void)
 | 
			
		||||
	exec sql rollback;
 | 
			
		||||
	exec sql disconnect;
 | 
			
		||||
 | 
			
		||||
	return (0);
 | 
			
		||||
	return 0;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -210,7 +210,7 @@ main(void)
 | 
			
		||||
	}
 | 
			
		||||
	free(numarr);
 | 
			
		||||
 | 
			
		||||
	return (0);
 | 
			
		||||
	return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
 
 | 
			
		||||
@@ -91,5 +91,5 @@ int main()
 | 
			
		||||
 | 
			
		||||
    EXEC SQL disconnect all;
 | 
			
		||||
 | 
			
		||||
    return( 0 );
 | 
			
		||||
    return 0;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -252,5 +252,5 @@ exec sql end declare section;
 | 
			
		||||
	strcpy(msg, "disconnect");
 | 
			
		||||
	exec sql disconnect all;
 | 
			
		||||
 | 
			
		||||
	return (0);
 | 
			
		||||
	return 0;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -58,5 +58,5 @@ exec sql end declare section;
 | 
			
		||||
	exec sql commit;
 | 
			
		||||
	exec sql disconnect;
 | 
			
		||||
 | 
			
		||||
	return (0);
 | 
			
		||||
	return 0;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -123,5 +123,5 @@ main (void)
 | 
			
		||||
	strcpy(msg, "disconnect");
 | 
			
		||||
	exec sql disconnect;
 | 
			
		||||
 | 
			
		||||
	return (0);
 | 
			
		||||
	return 0;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -96,5 +96,5 @@ int main()
 | 
			
		||||
    EXEC SQL disconnect all;
 | 
			
		||||
 | 
			
		||||
	/* All the memory will anyway be freed at the end */
 | 
			
		||||
    return( 0 );
 | 
			
		||||
    return 0;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -23,5 +23,5 @@ int main(void)
 | 
			
		||||
  printf("%s %s %s %s %s %s\n", s1, s2, s3, s4, s5, s6);
 | 
			
		||||
 | 
			
		||||
  exec sql disconnect;
 | 
			
		||||
  return (0);
 | 
			
		||||
  return 0;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -97,5 +97,5 @@ exec sql end declare section;
 | 
			
		||||
	strcpy(msg, "disconnect");
 | 
			
		||||
	exec sql disconnect;
 | 
			
		||||
 | 
			
		||||
	return (0);
 | 
			
		||||
	return 0;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -107,5 +107,5 @@ EXEC SQL END DECLARE SECTION;
 | 
			
		||||
 | 
			
		||||
	free(t);
 | 
			
		||||
 | 
			
		||||
	return (0);
 | 
			
		||||
	return 0;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -195,5 +195,5 @@ exec sql end declare section;
 | 
			
		||||
	strcpy(msg, "disconnect");
 | 
			
		||||
	exec sql disconnect;
 | 
			
		||||
 | 
			
		||||
	return (0);
 | 
			
		||||
	return 0;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -109,5 +109,5 @@ exec sql end declare section;
 | 
			
		||||
	exec sql commit;
 | 
			
		||||
	exec sql disconnect;
 | 
			
		||||
 | 
			
		||||
	return (0);
 | 
			
		||||
	return 0;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -86,5 +86,5 @@ exec sql end declare section;
 | 
			
		||||
	exec sql commit;
 | 
			
		||||
	exec sql disconnect;
 | 
			
		||||
 | 
			
		||||
	return (0);
 | 
			
		||||
	return 0;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -246,5 +246,5 @@ exec sql end declare section;
 | 
			
		||||
	strcpy(msg, "disconnect");
 | 
			
		||||
	exec sql disconnect;
 | 
			
		||||
 | 
			
		||||
	return (0);
 | 
			
		||||
	return 0;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -40,5 +40,5 @@ int main(void)
 | 
			
		||||
	strcpy(msg, "disconnect");
 | 
			
		||||
	exec sql disconnect current;
 | 
			
		||||
 | 
			
		||||
	return (0);
 | 
			
		||||
	return 0;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -60,7 +60,7 @@ int main()
 | 
			
		||||
  if( threads == NULL )
 | 
			
		||||
    {
 | 
			
		||||
      fprintf(stderr, "Cannot alloc memory\n");
 | 
			
		||||
      return( 1 );
 | 
			
		||||
      return 1;
 | 
			
		||||
    }
 | 
			
		||||
  for( n = 0; n < nthreads; n++ )
 | 
			
		||||
    {
 | 
			
		||||
@@ -92,7 +92,7 @@ int main()
 | 
			
		||||
  else
 | 
			
		||||
    printf("ERROR: Failure - expecting %d rows, got %d.\n", nthreads * iterations, l_rows);
 | 
			
		||||
 | 
			
		||||
  return( 0 );
 | 
			
		||||
  return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void *test_thread(void *arg)
 | 
			
		||||
@@ -121,7 +121,7 @@ void *test_thread(void *arg)
 | 
			
		||||
  if( sqlca.sqlcode != 0 )
 | 
			
		||||
    {
 | 
			
		||||
      printf("%s: ERROR: cannot connect to database!\n", l_connection);
 | 
			
		||||
      return( NULL );
 | 
			
		||||
      return NULL;
 | 
			
		||||
    }
 | 
			
		||||
  EXEC SQL AT :l_connection BEGIN;
 | 
			
		||||
 | 
			
		||||
@@ -136,6 +136,6 @@ void *test_thread(void *arg)
 | 
			
		||||
  /* all done */
 | 
			
		||||
  EXEC SQL AT :l_connection COMMIT;
 | 
			
		||||
  EXEC SQL DISCONNECT :l_connection;
 | 
			
		||||
  return( NULL );
 | 
			
		||||
  return NULL;
 | 
			
		||||
}
 | 
			
		||||
#endif /* ENABLE_THREAD_SAFETY */
 | 
			
		||||
 
 | 
			
		||||
@@ -61,7 +61,7 @@ int main()
 | 
			
		||||
  if( threads == NULL )
 | 
			
		||||
    {
 | 
			
		||||
      fprintf(stderr, "Cannot alloc memory\n");
 | 
			
		||||
      return( 1 );
 | 
			
		||||
      return 1;
 | 
			
		||||
    }
 | 
			
		||||
  for( n = 0; n < nthreads; n++ )
 | 
			
		||||
    {
 | 
			
		||||
@@ -93,7 +93,7 @@ int main()
 | 
			
		||||
  else
 | 
			
		||||
    printf("ERROR: Failure - expecting %d rows, got %d.\n", nthreads * iterations, l_rows);
 | 
			
		||||
 | 
			
		||||
  return( 0 );
 | 
			
		||||
  return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void *test_thread(void *arg)
 | 
			
		||||
@@ -122,7 +122,7 @@ void *test_thread(void *arg)
 | 
			
		||||
  if( sqlca.sqlcode != 0 )
 | 
			
		||||
    {
 | 
			
		||||
      printf("%s: ERROR: cannot connect to database!\n", l_connection);
 | 
			
		||||
      return( NULL );
 | 
			
		||||
      return NULL;
 | 
			
		||||
    }
 | 
			
		||||
  EXEC SQL BEGIN;
 | 
			
		||||
 | 
			
		||||
@@ -137,6 +137,6 @@ void *test_thread(void *arg)
 | 
			
		||||
  /* all done */
 | 
			
		||||
  EXEC SQL COMMIT;
 | 
			
		||||
  EXEC SQL DISCONNECT :l_connection;
 | 
			
		||||
  return( NULL );
 | 
			
		||||
  return NULL;
 | 
			
		||||
}
 | 
			
		||||
#endif /* ENABLE_THREAD_SAFETY */
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user