Commit Graph

251 Commits

Author SHA1 Message Date
Michael Meskes 991b9740ac *** empty log message *** 2000-02-22 19:57:12 +00:00
Michael Meskes bc8a39beef *** empty log message *** 2000-02-18 16:02:49 +00:00
Michael Meskes ab0c8c691e *** empty log message *** 2000-02-18 14:34:12 +00:00
Michael Meskes e3befe4a66 *** empty log message *** 2000-02-18 08:49:07 +00:00
Michael Meskes b3b35e98b6 *** empty log message *** 2000-02-17 19:48:58 +00:00
Michael Meskes 35ba9de276 *** empty log message *** 2000-02-16 16:18:29 +00:00
Michael Meskes 5933f1857f *** empty log message *** 2000-02-16 11:52:25 +00:00
Michael Meskes 30f16e72a4 *** empty log message *** 2000-02-15 19:23:20 +00:00
Michael Meskes 72786e04fd *** empty log message *** 2000-02-15 12:15:57 +00:00
Michael Meskes 08b999f1bd *** empty log message *** 2000-02-14 10:00:06 +00:00
Jan Wieck 74d53d7838 Made prototypes for yyerror() consistent with Bruce's last changes
Jan
2000-02-04 18:45:23 +00:00
Michael Meskes b53955f38a *** empty log message *** 2000-01-27 19:01:35 +00:00
Bruce Momjian 5c25d60244 Add:
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc

to all files copyright Regents of Berkeley.  Man, that's a lot of files.
2000-01-26 05:58:53 +00:00
Tom Lane b6fdd14765 ecpg shouldn't depend on parser/gramparse.h. Also, eliminate some
compiler warnings caused by lack of extern declarations in extern.h.
I believe the remaining gcc warnings here would go away if the ecpg
grammar could be tweaked so it doesn't use REJECT ...
2000-01-20 05:23:26 +00:00
Michael Meskes c80ba6a1b5 *** empty log message *** 2000-01-18 13:03:49 +00:00
Bruce Momjian 3f03f74f36 Update int28out and out8out and _in_ functions to handle trailing zeros
properly.
2000-01-10 15:41:34 +00:00
Bruce Momjian 69d4299e3e This patch removes the initialization of ri in loop in
quote_postgres(...) in ecpglib.c.

The code in CVS reads:

quote_postgres(char *arg, int lineno)
{
 char    *res = (char *) ecpg_alloc(2 * strlen(arg) + 3, lineno);
 int   i,
    ri = 0;

 if (!res)
  return (res);

 res[ri++] = '\'';
 for (i = 0, ri=0; arg[i]; i++, ri++)
 {
  switch (arg[i])
  {
   case '\'':
    res[ri++] = '\'';
    break;
   case '\\':
    res[ri++] = '\\';
    break;
   default:
    ;
  }

The problem here is that ri is reset to 0, thus overwriting the initial
quote.

Stephen Birch
2000-01-08 22:58:03 +00:00
Michael Meskes 33d71e3037 *** empty log message *** 2000-01-07 08:01:18 +00:00
Tom Lane bc036a063d Put back erroneously-removed definition of 'defines' variable. 1999-12-26 21:31:35 +00:00
Michael Meskes bd5ea42a8d *** empty log message *** 1999-12-23 12:33:19 +00:00
Bruce Momjian b57b0e0445 The first fix is to allow an input file with a relative path and without
a ".pgc " extension. The second patch fixes a coredump when there is
more than one input file (in that case, cur and types were not set to
NULL before processing the second f ile)

The patch below modifies the accepted grammar of ecpg to accept

 FETCH [direction] [amount] cursor name

i.e. the IN|FROM clause becomes optional (as in Oracle and Informix).
This removes the incompatibility mentioned in section "Porting From
Other RDBMS Packages" p169, PostgreSQL Programmer's Guide. The grammar
is modified in such a way as to avoid shift/reduce conflicts. It does
not accept the statement "EXEC SQL FETCH;" anymore, as the old grammar
did (this seems to be a bug of the old grammar anyway).

This patch cleans up the handling of space characters in the scanner;
some patte rns require \n to be in {space}, some do not. A second fix is
the handling of cpp continuati on lines; the old pattern did not match
these. The parser is patched to fix an off-by-one error in the #line
directives. The pa rser is also enhanced to report the correct location
of errors in declarations in the "E XEC SQL DECLARE SECTION". Finally,
some right recursions in the parser were replaced by  left-recursions.


This patch adds preprocessor directives to ecpg; in particular

EXEC SQL IFDEF, EXEC SQL IFNDEF, EXEC SQL ELSE, EXEC SQL ELIF and EXEC SQL ENDIF

"EXEC SQL IFDEF" is used with defines made with "EXEC SQL DEFINE" and
defines, specified on the command line with -D. Defines, specified on
the command line are persistent across multiple input files. Defines can
be nested up to a maximum level of 128 (see patch). There is a fair
amount of error checking to make sure directives are matched properly. I
need preprocessor directives for porting code, that is written for an
Informix database, to a PostgreSQL database, while maintaining
compatibility with the original code. I decided not to extend the
already large ecpg grammar. Everything is done in the scanner by adding
some states, e.g. to skip all input except newlines and directives. The
preprocessor commands are compatible with Informix. Oracle uses a cpp
replacement.

Rene Hogendoorn
1999-12-21 17:42:16 +00:00
Michael Meskes 50a5b4ab41 *** empty log message *** 1999-12-16 06:53:12 +00:00
Bruce Momjian 9805abb0fb This patch solves a couple of memory leaks in ecpglib.c. The patch is
ok for both the
development tree (CVS) and for 6.5.3.

 Stephen Birch
1999-12-14 22:03:48 +00:00
Bruce Momjian 97dec77fab Rename several destroy* functions/tags to drop*. 1999-12-10 03:56:14 +00:00
Michael Meskes 7cf0f634d5 *** empty log message *** 1999-12-08 09:52:29 +00:00
Michael Meskes 54847b25d4 *** empty log message *** 1999-12-07 10:29:18 +00:00
Bruce Momjian 54ffd4677a ecpg ECPGFree fix from Rene Hogendoorn. 1999-11-23 19:47:14 +00:00
Bruce Momjian 85bb91a319 Fix _cplusplus test in both trees. 1999-11-23 18:49:55 +00:00
Michael Meskes 36b0f67335 *** empty log message *** 1999-11-23 10:32:16 +00:00
Michael Meskes e30c2d67ef *** empty log message *** 1999-11-22 12:48:48 +00:00
Michael Meskes a2c834f709 *** empty log message *** 1999-11-02 19:03:34 +00:00
Michael Meskes 7ff8a18030 *** empty log message *** 1999-11-02 12:11:53 +00:00
Michael Meskes 969093b785 *** empty log message *** 1999-10-29 19:39:31 +00:00
Michael Meskes d3571c755e *** empty log message *** 1999-10-27 14:36:09 +00:00
Tom Lane 51f62d505e Standardize on MAXPGPATH as the size of a file pathname buffer,
eliminating some wildly inconsistent coding in various parts of the
system.  I set MAXPGPATH = 1024 in config.h.in.  If anyone is really
convinced that there ought to be a configure-time test to set the
value, go right ahead ... but I think it's a waste of time.
1999-10-25 03:08:03 +00:00
Tom Lane 45c002460c Remove fixed-size literal buffer from ecpg's lexer (same
fix recently applied to backend's lexer).  I see that YY_USES_REJECT
still gets defined for this lexer, which means it's going to have trouble
parsing really long tokens.  Not sure if it's worth doing anything about
that or not; I don't have the interest right now to understand why
ecpg's additions to the syntax cause this problem...
1999-10-22 23:14:50 +00:00
Michael Meskes 6fb3c3f78f *** empty log message *** 1999-10-15 19:02:08 +00:00
Bruce Momjian c3ac9f07b7 Hi,
I have changed a bit the makefiles for the win32 port - the *.def files
(created when building shared libraries) are now clean from
Makefile.shlib.

I have also removed "-g" from CFLAGS in the "cygwin32" template - it can
be
enabled when running configure.

                        Dan
1999-10-13 11:38:42 +00:00
Michael Meskes a4f59da146 *** empty log message *** 1999-10-08 11:05:05 +00:00
Bruce Momjian 9394d62c73 I have been working with user defined types and user defined c
functions.  One problem that I have encountered with the function
manager is that it does not allow the user to define type conversion
functions that convert between user types. For instance if mytype1,
mytype2, and mytype3 are three Postgresql user types, and if I wish to
define Postgresql conversion functions like

I run into problems, because the Postgresql dynamic loader would look
for a single link symbol, mytype3, for both pieces of object code.  If
I just change the name of one of the Postgresql functions (to make the
symbols distinct), the automatic type conversion that Postgresql uses,
for example, when matching operators to arguments no longer finds the
type conversion function.

The solution that I propose, and have implemented in the attatched
patch extends the CREATE FUNCTION syntax as follows. In the first case
above I use the link symbol mytype2_to_mytype3 for the link object
that implements the first conversion function, and define the
Postgresql operator with the following syntax

The patch includes changes to the parser to include the altered
syntax, changes to the ProcedureStmt node in nodes/parsenodes.h,
changes to commands/define.c to handle the extra information in the AS
clause, and changes to utils/fmgr/dfmgr.c that alter the way that the
dynamic loader figures out what link symbol to use.  I store the
string for the link symbol in the prosrc text attribute of the pg_proc
table which is currently unused in rows that reference dynamically
loaded
functions.


Bernie Frankpitt
1999-09-28 04:34:56 +00:00
Bruce Momjian 3f5a164387 Hello,
Two patches included:
- the first one enables the use of bool variables in fields which might
become NULL.
  Up to now the lib told you that NULL is not a bool variable, even if
you provide a indicator.

- the second patch checks whether a value is null and issues an error if
no indicator is provided.

Sidenote: IIRC, the variable should be left alone if the value is NULL.
ECPGlib sets it's value to 0 on NULL. Is this a violation of the
standard?

Regards
     Christof
1999-09-27 19:16:29 +00:00
Michael Meskes 66270c94e1 *** empty log message *** 1999-09-27 10:41:02 +00:00
Michael Meskes 231c5935a4 *** empty log message *** 1999-09-17 18:28:15 +00:00
Michael Meskes 68ee58ed43 *** empty log message *** 1999-09-17 09:48:25 +00:00
Michael Meskes 864e1e9d0e *** empty log message *** 1999-09-15 08:29:25 +00:00
Tom Lane b65ab31910 Eliminate token length assumption in scanstr(). 1999-09-11 22:26:47 +00:00
Tom Lane c9d040d85e Un-break code generated by ECPGRelease production. 1999-08-22 20:37:24 +00:00
Michael Meskes b2a2be4c5a *** empty log message *** 1999-08-02 04:59:18 +00:00
Michael Meskes 9f0ffa2241 *** empty log message *** 1999-07-19 12:37:48 +00:00
Bruce Momjian e44c931801 Re-add getopt.h check, remove NT-specific tests for it. 1999-07-19 02:27:16 +00:00
Bruce Momjian c9acd2da12 Remove getopt configure check. 1999-07-19 01:18:05 +00:00
Bruce Momjian c981442772 Update ecpg compile. 1999-07-18 21:07:02 +00:00
Bruce Momjian cb08547646 Add getopt test. 1999-07-18 21:02:56 +00:00
Bruce Momjian 07262a2dfb Update configure include checks. 1999-07-18 16:42:16 +00:00
Bruce Momjian 3406901a29 Move some system includes into c.h, and remove duplicates. 1999-07-17 20:18:55 +00:00
Tom Lane 8ee07b506d Tired of seeing that 'unused variable' warning... 1999-07-16 23:15:46 +00:00
Bruce Momjian 4b2c2850bf Clean up #include in /include directory. Add scripts for checking includes. 1999-07-15 15:21:54 +00:00
Bruce Momjian ad4948862c Remove S*I comments from Stephan. 1999-07-13 21:17:45 +00:00
Tom Lane 73efd3867d Fix gcc complaint about long being passed to sprintf %d. 1999-07-09 22:53:40 +00:00
Bruce Momjian 3acb7d1634 Test Case:
----------
exec sql begin declare section;
   short s ;
   unsigned short us;
exec sql end   declare section;
exec sql create table test(s smallint, us smallint);
exec sql commit;
s = 1; us =32000;
exec sql insert into test values( :s, :us ) ;  <== error

Error Message: "i4toi2: '-600309759' causes int2 underflow"

Masaaki Sakaida
1999-07-08 03:32:57 +00:00
Bruce Momjian eba41848aa Clarify maximum tuple and max attribute lengths. 1999-07-04 04:56:02 +00:00
Bruce Momjian 97dfff832c Fix to prevent too large tuple from being created. 1999-07-03 00:33:04 +00:00
Tom Lane fa179dde82 Make sure symlinks for sharedlib get removed by 'make clean'. 1999-06-30 23:57:31 +00:00
Michael Meskes 9b0e20574b *** empty log message *** 1999-06-29 09:25:25 +00:00
Michael Meskes 19630e0cbc *** empty log message *** 1999-06-25 10:42:06 +00:00
Michael Meskes d12561040c *** empty log message *** 1999-06-24 13:15:31 +00:00
Michael Meskes c6a6597862 *** empty log message *** 1999-06-16 18:35:51 +00:00
Michael Meskes c70db13265 *** empty log message *** 1999-06-16 18:25:50 +00:00
Michael Meskes 70dfc8c11e *** empty log message *** 1999-06-10 19:11:33 +00:00
Marc G. Fournier 840306af04 ecpg.patch (wrong makefile expansion in some cases)
the ecpg Makefiles use a variable DESTDIR which is never defined
        except by debian/rules makefile, in which case the ecpg makefiles
        expand wrong pathnames. If we want to support a DESTDIR root it
        must be done consistently in all the makefiles, not just in ecpg.

From: Massimo Dal Zotto <dz@cs.unitn.it>
1999-06-05 04:13:21 +00:00
Bruce Momjian 07842084fe pgindent run over code. 1999-05-25 16:15:34 +00:00
Michael Meskes 4b04b01aaa *** empty log message *** 1999-05-25 13:36:15 +00:00
Michael Meskes a7b06f20c5 *** empty log message *** 1999-05-21 16:36:27 +00:00
Bruce Momjian 6d08b6a7b8 Remove 4096 string limited key on block size 1999-05-19 17:53:12 +00:00
Michael Meskes 21e03211cf *** empty log message *** 1999-05-18 05:20:17 +00:00
Michael Meskes c8bd630af6 *** empty log message *** 1999-05-14 06:56:18 +00:00
Michael Meskes e18c912acf *** empty log message *** 1999-05-07 18:03:37 +00:00
Bruce Momjian 210055ad61 here are some patches for 6.5.0 which I already submitted but have never
been applied. The patches are in the .tar.gz attachment at the end:

varchar-array.patch     this patch adds support for arrays of bpchar() and
                        varchar(), which where always missing from postgres.

                        These datatypes can be used to replace the _char4,
                        _char8, etc., which were dropped some time ago.

block-size.patch        this patch fixes many errors in the parser and other
                        program which happen with very large query statements
                        (> 8K) when using a page size larger than 8192.

                        This patch is needed if you want to submit queries
                        larger than 8K. Postgres supports tuples up to 32K
                        but you can't insert them because you can't submit
                        queries larger than 8K. My patch fixes this problem.

                        The patch also replaces all the occurrences of `8192'
                        and `1<<13' in the sources with the proper constants
                        defined in include files. You should now never find
                        8192 hardwired in C code, just to make code clearer.


--
Massimo Dal Zotto
1999-05-03 19:10:48 +00:00
Michael Meskes dd6b1aaa25 *** empty log message *** 1999-04-26 05:28:48 +00:00
Michael Meskes ad5a54d170 *** empty log message *** 1999-04-16 12:26:49 +00:00
Michael Meskes 29e2916827 *** empty log message *** 1999-04-14 18:51:37 +00:00
Michael Meskes df6e504437 *** empty log message *** 1999-04-13 12:36:38 +00:00
Michael Meskes d471f8073a *** empty log message *** 1999-03-24 20:05:15 +00:00
Tom Lane b01a272755 Add .cvsignore file so cvs doesn't complain if you have lex/yacc
output files laying about.
1999-03-21 02:43:58 +00:00
Michael Meskes e4274d60a5 *** empty log message *** 1999-03-20 19:46:54 +00:00
Tom Lane a4ce6f00f8 Remove yacc/lex output files from CVS repository. 1999-03-20 18:45:27 +00:00
Tom Lane e8f9b6baed make clean should remove lex.yy.c 1999-03-20 17:58:21 +00:00
Bruce Momjian 0aa2aed5f8 Reverse out pfree agg part of patch from Erik Riedel. 1999-03-20 13:18:20 +00:00
Bruce Momjian bd6f98af31 I suggest the following portability patch, which does not
change functionality, but makes the code more ANSI C'ish.
My AIX xlc compiler barfs on all of these. Can someone please
review and apply to current.

 <<port.patch>>
Thanks
Andreas
1999-03-19 18:56:43 +00:00
Michael Meskes 7729ba073d *** empty log message *** 1999-03-18 15:20:33 +00:00
Bruce Momjian 89b762e509 Fix snprintf with strings, and nextval('"Aa"'); 1999-03-16 04:26:01 +00:00
Michael Meskes 75380d3eae *** empty log message *** 1999-03-15 18:26:55 +00:00
Bruce Momjian d66a44a58c Reversed out libpq protocol patch for Tom Lane. 1999-03-14 18:12:21 +00:00
Bruce Momjian 80db587e7b Here is a little syntax error found in a .y file... A dropped semi.
DwD
--
Daryl W. Dunbar
1999-03-14 16:40:18 +00:00
Michael Meskes f9f458be10 *** empty log message *** 1999-03-11 15:42:08 +00:00
Michael Meskes 6f66fd8c2e *** empty log message *** 1999-03-07 08:01:18 +00:00
Michael Meskes 03842eb03b *** empty log message *** 1999-03-05 09:38:51 +00:00
Michael Meskes 9db6b7f3f7 *** empty log message *** 1999-03-05 09:25:34 +00:00
Marc G. Fournier d077c61492 From: Michael Meskes <Michael_Meskes@topmail.de>
+
+ Tue Feb 23 17:32:25 CET 1999
+
+       - Other than a struct a union itself cannot be specified as variable.
+
+ Fri Feb 26 07:18:25 CET 1999
+
+       - Synced preproc.y with gram.y.
+
+ Sat Feb 27 20:30:03 CET 1999
+
+       - Added automatic allocating for NULL pointers.
1999-02-28 07:25:34 +00:00
Marc G. Fournier fa9db42a6e From: Michael Meskes <Michael_Meskes@topmail.de>
+
+ Son Feb 21 14:10:47 CET 1999
+
+       - Fixed variable detection in libecpg.
+
+ Mon Feb 22 19:47:45 CET 1999
+
+       - Added 'at <db_connection>' option to all commands it is apllicable
+         to. Due to changing the API of some libecpg functions this
+         requires me to increase the major version number.
+       - Synced pgc.l with scan.l.
+       - Added support for unions.
+       - Set library version to 3.0.0
+       - Set ecpg version to 3.0.0
1999-02-23 12:57:03 +00:00