~ubuntu-branches/ubuntu/saucy/postgresql-8.4/saucy

« back to all changes in this revision

Viewing changes to src/pl/plpgsql/src/pl_scan.c

  • Committer: Package Import Robot
  • Author(s): Martin Pitt
  • Date: 2011-12-02 14:46:33 UTC
  • mfrom: (13.1.8 sid)
  • Revision ID: package-import@ubuntu.com-20111202144633-azdcoyqh7sduwr15
Tags: 8.4.10-1
* New upstream bug fix release:
  - Fix bugs in information_schema.referential_constraints view.
    This view was being insufficiently careful about matching the
    foreign-key constraint to the depended-on primary or unique key
    constraint. That could result in failure to show a foreign key
    constraint at all, or showing it multiple times, or claiming that
    it depends on a different constraint than the one it really does.
    Since the view definition is installed by initdb, merely upgrading
    will not fix the problem. If you need to fix this in an existing
    installation, you can (as a superuser) drop the information_schema
    schema then re-create it by sourcing
    "SHAREDIR/information_schema.sql". (Run pg_config --sharedir if
    you're uncertain where "SHAREDIR" is.) This must be repeated in
    each database to be fixed.
  - Fix incorrect replay of WAL records for GIN index updates.
    This could result in transiently failing to find index entries
    after a crash, or on a hot-standby server. The problem would be
    repaired by the next "VACUUM" of the index, however.
  - Fix TOAST-related data corruption during CREATE TABLE dest AS
    SELECT - FROM src or INSERT INTO dest SELECT * FROM src.
    If a table has been modified by "ALTER TABLE ADD COLUMN", attempts
    to copy its data verbatim to another table could produce corrupt
    results in certain corner cases. The problem can only manifest in
    this precise form in 8.4 and later, but we patched earlier versions
    as well in case there are other code paths that could trigger the
    same bug.
  - Fix race condition during toast table access from stale syscache
    entries.
  - Track dependencies of functions on items used in parameter default
    expressions. Previously, a referenced object could be dropped without
    having dropped or modified the function, leading to misbehavior when the
    function was used. Note that merely installing this update will not fix
    the missing dependency entries; to do that, you'd need to "CREATE OR
    REPLACE" each such function afterwards. If you have functions whose
    defaults depend on non-built-in objects, doing so is recommended.
  - Allow inlining of set-returning SQL functions with multiple OUT
    parameters.
  - Make DatumGetInetP() unpack inet datums that have a 1-byte header,
    and add a new macro, DatumGetInetPP(), that does not.
  - Improve locale support in money type's input and output.
    Aside from not supporting all standard lc_monetary formatting
    options, the input and output functions were inconsistent, meaning
    there were locales in which dumped money values could not be
    re-read.
  - Don't let transform_null_equals affect CASE foo WHEN NULL ...
    constructs. transform_null_equals is only supposed to affect foo = NULL
    expressions written directly by the user, not equality checks
    generated internally by this form of CASE.
  - Change foreign-key trigger creation order to better support
    self-referential foreign keys. For a cascading foreign key that
    references its own table, a row update will fire both the ON UPDATE
    trigger and the CHECK trigger as one event. The ON UPDATE trigger must
    execute first, else the CHECK will check a non-final state of the row
    and possibly throw an inappropriate error. However, the firing order of
    these triggers is determined by their names, which generally sort in
    creation order since the triggers have auto-generated names following
    the convention "RI_ConstraintTrigger_NNNN". A proper fix would require
    modifying that convention, which we will do in 9.2, but it seems risky
    to change it in existing releases. So this patch just changes the
    creation order of the triggers. Users encountering this type of error
    should drop and re-create the foreign key constraint to get its triggers
    into the right order.
  - Avoid floating-point underflow while tracking buffer allocation
    rate.
  - Preserve blank lines within commands in psql's command history.
    The former behavior could cause problems if an empty line was
    removed from within a string literal, for example.
  - Fix pg_dump to dump user-defined casts between auto-generated
    types, such as table rowtypes.
  - Use the preferred version of xsubpp to build PL/Perl, not
    necessarily the operating system's main copy.
  - Fix incorrect coding in "contrib/dict_int" and "contrib/dict_xsyn".
  - Honor query cancel interrupts promptly in pgstatindex().
  - Ensure VPATH builds properly install all server header files.
  - Shorten file names reported in verbose error messages.
    Regular builds have always reported just the name of the C file
    containing the error message call, but VPATH builds formerly
    reported an absolute path name.

Show diffs side-by-side

added added

removed removed

Lines of Context:
73
73
typedef unsigned char flex_uint8_t; 
74
74
typedef unsigned short int flex_uint16_t;
75
75
typedef unsigned int flex_uint32_t;
76
 
#endif /* ! C99 */
77
76
 
78
77
/* Limits of integral types. */
79
78
#ifndef INT8_MIN
104
103
#define UINT32_MAX             (4294967295U)
105
104
#endif
106
105
 
 
106
#endif /* ! C99 */
 
107
 
107
108
#endif /* ! FLEXINT_H */
108
109
 
109
110
#ifdef __cplusplus
160
161
 
161
162
/* Size of default input buffer. */
162
163
#ifndef YY_BUF_SIZE
 
164
#ifdef __ia64__
 
165
/* On IA-64, the buffer size is 16k, not 8k.
 
166
 * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
 
167
 * Ditto for the __ia64__ case accordingly.
 
168
 */
 
169
#define YY_BUF_SIZE 32768
 
170
#else
163
171
#define YY_BUF_SIZE 16384
 
172
#endif /* __ia64__ */
164
173
#endif
165
174
 
166
175
/* The state buf must be large enough to hold one state per character in the main buffer.
1253
1262
 * with comments go away.
1254
1263
 */
1255
1264
/* This is a simpler treatment of quoted identifiers than the core uses */
1256
 
#line 1257 "pl_scan.c"
 
1265
#line 1266 "pl_scan.c"
1257
1266
 
1258
1267
#define INITIAL 0
1259
1268
#define xc 1
1336
1345
 
1337
1346
/* Amount of stuff to slurp up with each read. */
1338
1347
#ifndef YY_READ_BUF_SIZE
 
1348
#ifdef __ia64__
 
1349
/* On IA-64, the buffer size is 16k, not 8k */
 
1350
#define YY_READ_BUF_SIZE 16384
 
1351
#else
1339
1352
#define YY_READ_BUF_SIZE 8192
 
1353
#endif /* __ia64__ */
1340
1354
#endif
1341
1355
 
1342
1356
/* Copy whatever the last rule matched to the standard output. */
1344
1358
/* This used to be an fputs(), but since the string might contain NUL's,
1345
1359
 * we now use fwrite().
1346
1360
 */
1347
 
#define ECHO fwrite( plpgsql_base_yytext, plpgsql_base_yyleng, 1, plpgsql_base_yyout )
 
1361
#define ECHO do { if (fwrite( plpgsql_base_yytext, plpgsql_base_yyleng, 1, plpgsql_base_yyout )) {} } while (0)
1348
1362
#endif
1349
1363
 
1350
1364
/* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
1355
1369
        if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
1356
1370
                { \
1357
1371
                int c = '*'; \
1358
 
                int n; \
 
1372
                size_t n; \
1359
1373
                for ( n = 0; n < max_size && \
1360
1374
                             (c = getc( plpgsql_base_yyin )) != EOF && c != '\n'; ++n ) \
1361
1375
                        buf[n] = (char) c; \
1461
1475
     * The keyword rules
1462
1476
     * ----------
1463
1477
     */
1464
 
#line 1465 "pl_scan.c"
 
1478
#line 1479 "pl_scan.c"
1465
1479
 
1466
1480
        if ( !(yy_init) )
1467
1481
                {
2188
2202
#line 392 "scan.l"
2189
2203
YY_FATAL_ERROR( "flex scanner jammed" );
2190
2204
        YY_BREAK
2191
 
#line 2192 "pl_scan.c"
 
2205
#line 2206 "pl_scan.c"
2192
2206
case YY_STATE_EOF(INITIAL):
2193
2207
        yyterminate();
2194
2208
 
2909
2923
 
2910
2924
/** Setup the input buffer state to scan the given bytes. The next call to plpgsql_base_yylex() will
2911
2925
 * scan from a @e copy of @a bytes.
2912
 
 * @param bytes the byte buffer to scan
2913
 
 * @param len the number of bytes in the buffer pointed to by @a bytes.
 
2926
 * @param yybytes the byte buffer to scan
 
2927
 * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
2914
2928
 * 
2915
2929
 * @return the newly allocated buffer state object.
2916
2930
 */