*** postgresql-6.5.3/src/backend/access/rtree/rtree.c.orig Mon Aug 2 14:24:44 1999 --- postgresql-6.5.3/src/backend/access/rtree/rtree.c Fri Jan 7 15:31:51 2000 *************** *** 843,849 **** pfree(datum_r); pfree(union_dl); datum_r = union_dr; ! size_r = size_alpha; *right++ = i; v->spl_nright++; } --- 843,849 ---- pfree(datum_r); pfree(union_dl); datum_r = union_dr; ! size_r = size_beta; *right++ = i; v->spl_nright++; } *** postgresql-6.5.3/src/backend/catalog/indexing.c.orig Mon Aug 2 14:56:54 1999 --- postgresql-6.5.3/src/backend/catalog/indexing.c Fri Jan 7 15:31:52 2000 *************** *** 43,50 **** AttributeNumIndex, AttributeRelidIndex}; char *Name_pg_proc_indices[Num_pg_proc_indices] = {ProcedureNameIndex, ! ProcedureOidIndex, ! ProcedureSrcIndex}; char *Name_pg_type_indices[Num_pg_type_indices] = {TypeNameIndex, TypeOidIndex}; char *Name_pg_class_indices[Num_pg_class_indices] = {ClassNameIndex, --- 43,49 ---- AttributeNumIndex, AttributeRelidIndex}; char *Name_pg_proc_indices[Num_pg_proc_indices] = {ProcedureNameIndex, ! ProcedureOidIndex}; char *Name_pg_type_indices[Num_pg_type_indices] = {TypeNameIndex, TypeOidIndex}; char *Name_pg_class_indices[Num_pg_class_indices] = {ClassNameIndex, *************** *** 370,397 **** idesc = index_openr(ProcedureNameIndex); tuple = CatalogIndexFetchTuple(heapRelation, idesc, skey, 3); - - index_close(idesc); - - return tuple; - } - - - HeapTuple - ProcedureSrcIndexScan(Relation heapRelation, text *procSrc) - { - Relation idesc; - ScanKeyData skey[1]; - HeapTuple tuple; - - ScanKeyEntryInitialize(&skey[0], - (bits16) 0x0, - (AttrNumber) 1, - (RegProcedure) F_TEXTEQ, - PointerGetDatum(procSrc)); - - idesc = index_openr(ProcedureSrcIndex); - tuple = CatalogIndexFetchTuple(heapRelation, idesc, skey, 1); index_close(idesc); --- 369,374 ---- *** postgresql-6.5.3/src/backend/catalog/pg_proc.c.orig Mon Aug 2 14:56:55 1999 --- postgresql-6.5.3/src/backend/catalog/pg_proc.c Fri Jan 7 15:31:52 2000 *************** *** 131,136 **** --- 131,137 ---- */ if (!strcmp(procedureName, GENERICSETNAME)) { + #ifdef SETS_FIXED prosrctext = textin(prosrc); tup = SearchSysCacheTuple(PROSRC, PointerGetDatum(prosrctext), *************** *** 138,143 **** --- 139,147 ---- pfree(prosrctext); if (HeapTupleIsValid(tup)) return tup->t_data->t_oid; + #else + elog(ERROR, "lookup for procedure by source needs fix (Jan)"); + #endif } } *** postgresql-6.5.3/src/backend/commands/vacuum.c.orig Wed Aug 25 21:01:45 1999 --- postgresql-6.5.3/src/backend/commands/vacuum.c Fri Jan 7 15:31:52 2000 *************** *** 2405,2414 **** stup = heap_formtuple(sd->rd_att, values, nulls); /* ---------------- ! * insert the tuple in the relation and get the tuple's oid. * ---------------- */ ! heap_insert(sd, stup); pfree(DatumGetPointer(values[3])); pfree(DatumGetPointer(values[4])); pfree(stup); --- 2405,2425 ---- stup = heap_formtuple(sd->rd_att, values, nulls); /* ---------------- ! * Watch out for oversize tuple, which can happen if ! * both of the saved data values are long. ! * Our fallback strategy is just to not store the ! * pg_statistic tuple at all in that case. (We could ! * replace the values by NULLs and still store the ! * numeric stats, but presently selfuncs.c couldn't ! * do anything useful with that case anyway.) * ---------------- */ ! if (MAXALIGN(stup->t_len) <= MaxTupleSize) ! { ! /* OK to store tuple */ ! heap_insert(sd, stup); ! } ! pfree(DatumGetPointer(values[3])); pfree(DatumGetPointer(values[4])); pfree(stup); *** postgresql-6.5.3/src/backend/storage/lmgr/lock.c.orig Sat May 29 15:14:42 1999 --- postgresql-6.5.3/src/backend/storage/lmgr/lock.c Fri Jan 7 15:31:51 2000 *************** *** 940,946 **** { PROC_QUEUE *waitQueue = &(lock->waitProcs); LOCKMETHODTABLE *lockMethodTable = LockMethodTable[lockmethod]; ! char old_status[64], new_status[64]; Assert(lockmethod < NumLockMethods); --- 940,946 ---- { PROC_QUEUE *waitQueue = &(lock->waitProcs); LOCKMETHODTABLE *lockMethodTable = LockMethodTable[lockmethod]; ! static char old_status[64], new_status[64]; Assert(lockmethod < NumLockMethods); *** postgresql-6.5.3/src/backend/utils/adt/dt.c.orig Mon Aug 2 14:24:51 1999 --- postgresql-6.5.3/src/backend/utils/adt/dt.c Fri Jan 7 15:31:52 2000 *************** *** 811,816 **** --- 811,817 ---- * To add a month, increment the month, and use the same day of month. * Then, if the next month has fewer days, set the day of month * to the last day of month. + * Lastly, add in the "quantitative time". */ DateTime * datetime_pl_span(DateTime *datetime, TimeSpan *span) *************** *** 843,854 **** { dt = (DATETIME_IS_RELATIVE(*datetime) ? SetDateTime(*datetime) : *datetime); - #ifdef ROUND_ALL - dt = JROUND(dt + span->time); - #else - dt += span->time; - #endif - if (span->month != 0) { struct tm tt, --- 844,849 ---- *************** *** 889,894 **** --- 884,895 ---- DATETIME_INVALID(dt); } + #ifdef ROUND_ALL + dt = JROUND(dt + span->time); + #else + dt += span->time; + #endif + *result = dt; } *************** *** 2569,2575 **** tm2timespan(struct tm * tm, double fsec, TimeSpan *span) { span->month = ((tm->tm_year * 12) + tm->tm_mon); ! span->time = ((((((tm->tm_mday * 24) + tm->tm_hour) * 60) + tm->tm_min) * 60) + tm->tm_sec); span->time = JROUND(span->time + fsec); #ifdef DATEDEBUG --- 2570,2579 ---- tm2timespan(struct tm * tm, double fsec, TimeSpan *span) { span->month = ((tm->tm_year * 12) + tm->tm_mon); ! span->time = ((((((tm->tm_mday * 24.0) ! + tm->tm_hour) * 60.0) ! + tm->tm_min) * 60.0) ! + tm->tm_sec); span->time = JROUND(span->time + fsec); #ifdef DATEDEBUG *** postgresql-6.5.3/src/backend/utils/cache/syscache.c.orig Mon Aug 2 14:25:01 1999 --- postgresql-6.5.3/src/backend/utils/cache/syscache.c Fri Jan 7 15:31:52 2000 *************** *** 335,351 **** offsetof(FormData_pg_rewrite, ev_qual), NULL, (ScanFunc) NULL}, - {ProcedureRelationName, /* PROSRC */ - 1, - { - Anum_pg_proc_prosrc, - 0, - 0, - 0 - }, - offsetof(FormData_pg_proc, prosrc), - ProcedureSrcIndex, - (ScanFunc) ProcedureSrcIndexScan}, {OperatorClassRelationName, /* CLADEFTYPE */ 1, { --- 335,340 ---- *** postgresql-6.5.3/src/backend/utils/init/postinit.c.orig Mon Aug 2 14:25:10 1999 --- postgresql-6.5.3/src/backend/utils/init/postinit.c Fri Jan 7 15:31:51 2000 *************** *** 572,577 **** --- 572,581 ---- */ InitCatalogCache(); + /* start a new transaction here before access to db */ + if (!bootstrap) + StartTransactionCommand(); + /* ---------------- * set ourselves to the proper user id and figure out our postgres * user id. If we ever add security so that we check for valid *** postgresql-6.5.3/src/include/catalog/indexing.h.orig Sun Feb 14 08:21:03 1999 --- postgresql-6.5.3/src/include/catalog/indexing.h Fri Jan 7 15:31:52 2000 *************** *** 21,27 **** * Some definitions for indices on pg_attribute */ #define Num_pg_attr_indices 3 ! #define Num_pg_proc_indices 3 #define Num_pg_type_indices 2 #define Num_pg_class_indices 2 #define Num_pg_attrdef_indices 1 --- 21,27 ---- * Some definitions for indices on pg_attribute */ #define Num_pg_attr_indices 3 ! #define Num_pg_proc_indices 2 #define Num_pg_type_indices 2 #define Num_pg_class_indices 2 #define Num_pg_attrdef_indices 1 *************** *** 38,44 **** #define AttributeRelidIndex "pg_attribute_attrelid_index" #define ProcedureOidIndex "pg_proc_oid_index" #define ProcedureNameIndex "pg_proc_proname_narg_type_index" - #define ProcedureSrcIndex "pg_proc_prosrc_index" #define TypeOidIndex "pg_type_oid_index" #define TypeNameIndex "pg_type_typname_index" #define ClassOidIndex "pg_class_oid_index" --- 38,43 ---- *************** *** 82,88 **** extern HeapTuple ProcedureOidIndexScan(Relation heapRelation, Oid procId); extern HeapTuple ProcedureNameIndexScan(Relation heapRelation, char *procName, int2 nargs, Oid *argTypes); - extern HeapTuple ProcedureSrcIndexScan(Relation heapRelation, text *procSrc); extern HeapTuple TypeOidIndexScan(Relation heapRelation, Oid typeId); extern HeapTuple TypeNameIndexScan(Relation heapRelation, char *typeName); extern HeapTuple ClassNameIndexScan(Relation heapRelation, char *relName); --- 81,86 ---- *************** *** 102,108 **** DECLARE_INDEX(pg_proc_oid_index on pg_proc using btree(oid oid_ops)); DECLARE_INDEX(pg_proc_proname_narg_type_index on pg_proc using btree(proname name_ops, pronargs int2_ops, proargtypes oid8_ops)); - DECLARE_INDEX(pg_proc_prosrc_index on pg_proc using btree(prosrc text_ops)); DECLARE_INDEX(pg_type_oid_index on pg_type using btree(oid oid_ops)); DECLARE_INDEX(pg_type_typname_index on pg_type using btree(typname name_ops)); --- 100,105 ---- *** postgresql-6.5.3/src/include/utils/syscache.h.orig Sun Feb 14 08:22:32 1999 --- postgresql-6.5.3/src/include/utils/syscache.h Fri Jan 7 15:31:52 2000 *************** *** 59,67 **** #define GRONAME 23 #define GROSYSID 24 #define REWRITENAME 25 ! #define PROSRC 26 ! #define CLADEFTYPE 27 ! #define LANOID 28 /* ---------------- * struct cachedesc: information needed for a call to InitSysCache() --- 59,66 ---- #define GRONAME 23 #define GROSYSID 24 #define REWRITENAME 25 ! #define CLADEFTYPE 26 ! #define LANOID 27 /* ---------------- * struct cachedesc: information needed for a call to InitSysCache() *** postgresql-6.5.3/src/interfaces/ecpg/lib/ecpglib.c.orig Thu Jul 8 12:32:57 1999 --- postgresql-6.5.3/src/interfaces/ecpg/lib/ecpglib.c Fri Jan 7 15:31:51 2000 *************** *** 228,235 **** --- 228,238 ---- switch (arg[i]) { case '\'': + res[ri++] = '\''; + break; case '\\': res[ri++] = '\\'; + break; default: ; } *************** *** 365,371 **** bool string = false; for (; *ptr != '\0' && (*ptr != '?' || string); ptr++) ! if (*ptr == '\'') string = string ? false : true; return (*ptr == '\0') ? NULL : ptr; --- 368,374 ---- bool string = false; for (; *ptr != '\0' && (*ptr != '?' || string); ptr++) ! if (*ptr == '\'' && *(ptr-1) != '\\') string = string ? false : true; return (*ptr == '\0') ? NULL : ptr; *************** *** 379,384 **** --- 382,388 ---- PGresult *results; PGnotify *notify; struct variable *var; + int hostvarl = 0; memcpy((char *) &sqlca, (char *) &sqlca_init, sizeof(sqlca)); *************** *** 569,575 **** return false; strcpy(newcopy, copiedquery); ! if ((p = next_insert(newcopy)) == NULL) { /* --- 573,579 ---- return false; strcpy(newcopy, copiedquery); ! if ((p = next_insert(newcopy+hostvarl)) == NULL) { /* *************** *** 582,587 **** --- 586,592 ---- else { strcpy(p, tobeinserted); + hostvarl = strlen(newcopy); /* * The strange thing in the second argument is the rest of the *************** *** 1227,1232 **** --- 1232,1238 ---- { struct connection *con; + memcpy((char *) &sqlca, (char *) &sqlca_init, sizeof(sqlca)); if (strcmp(connection_name, "ALL") == 0) { for (con = all_connections; con;)