1. 01 3月, 2005 1 次提交
  2. 28 2月, 2005 4 次提交
  3. 27 2月, 2005 10 次提交
  4. 26 2月, 2005 2 次提交
  5. 25 2月, 2005 10 次提交
  6. 24 2月, 2005 7 次提交
  7. 23 2月, 2005 2 次提交
  8. 22 2月, 2005 4 次提交
    • N
      This patch changes makes some significant changes to how compilation · 5a9dd0dc
      Neil Conway 提交于
      and parsing work in PL/PgSQL:
      
      - memory management is now done via palloc(). The compiled representation
        of each function now has its own memory context. Therefore, the storage
        consumed by a function can be reclaimed via MemoryContextDelete().
      
        During compilation, the CurrentMemoryContext is the function's memory
        context. This means that a palloc() is sufficient to allocate memory
        that will have the same lifetime as the function itself. As a result,
        code invoked during compilation should be careful to pfree() temporary
        allocations to avoid leaking memory. Since a lot of the code in the
        backend is not careful about releasing palloc'ed memory, that means
        we should switch into a temporary memory context before invoking
        backend functions. A temporary context appropriate for such allocations
        is `compile_tmp_cxt'.
      
      - The ability to use palloc() allows us to simply a lot of the code in
        the parser. Rather than representing lists of elements via ad hoc
        linked lists or arrays, we can use the List type. Rather than doing
        malloc followed by memset(0), we can just use palloc0().
      
      - We now check that the user has supplied the right number of parameters
        to a RAISE statement. Supplying either too few or too many results in
        an error (at runtime).
      
      - PL/PgSQL's parser needs to accept arbitrary SQL statements. Since we
        do not want to duplicate the SQL grammar in the PL/PgSQL grammar, this
        means we need to be quite lax in what the PL/PgSQL grammar considers
        a "SQL statement". This can lead to misleading behavior if there is a
        syntax error in the function definition, since we assume a malformed
        PL/PgSQL construct is a SQL statement. Furthermore, these errors were
        only detected at runtime (when we tried to execute the alleged "SQL
        statement" via SPI).
      
        To rectify this, the patch changes the parser to invoke the main SQL
        parser when it sees a string it believes to be a SQL expression. This
        means that synctically-invalid SQL will be rejected during the
        compilation of the PL/PgSQL function. This is only done when compiling
        for "validation" purposes (i.e. at CREATE FUNCTION time), so it should
        not impose a runtime overhead.
      
      - Fixes for the various buffer overruns I've patched in stable branches
        in the past few weeks. I've rewritten code where I thought it was
        warranted (unlike the patches applied to older branches, which were
        minimally invasive).
      
      - Various other minor changes and cleanups.
      
      - Updates to the regression tests.
      5a9dd0dc
    • B
      Add semicolon so snprintf.c goto has a statement to attach to: · e3ebe252
      Bruce Momjian 提交于
      nochar:
          /* nothing */
          ; /* semicolon required because a goto has to be attached to a statement */
      e3ebe252
    • B
      Use _() macro consistently rather than gettext(). Add translation · 0542b1e2
      Bruce Momjian 提交于
      macros around strings that were missing them.
      0542b1e2
    • B
      Add: · 64011b4d
      Bruce Momjian 提交于
      > 	* Add internationalized message strings
      64011b4d