1
0
mirror of https://github.com/postgres/postgres.git synced 2025-08-27 07:42:10 +03:00
Commit Graph

507 Commits

Author SHA1 Message Date
Bruce Momjian
48498602a0 Change \' to '', for SQL standards compliance. Backpatch to 7.3, 7.4,
and 8.0.  Later releases already patched.
2006-05-21 19:57:07 +00:00
Kris Jurka
43418e8702 In Blob.getBytes(long position, int length) position is an offset
starting at 1, not zero as the driver was previously doing.

Thanks to Emmanuel Bernard for the report.
2005-05-08 23:16:58 +00:00
Kris Jurka
5eed8ce382 Release build 216. 2005-04-22 15:10:52 +00:00
Kris Jurka
a44f99024c Updatable ResultSets need to check for an empty ResultSet because
isBeforeFirst and isAfterLast both return false for an empty result
so the checking to make sure the user is on a valid row wasn't
working.

Also don't allow an insert without specifying at least one column
value because INSERT INTO tab() values() is a syntax error.
2005-04-22 14:48:18 +00:00
Kris Jurka
f5517ddbda When moveToCurrentRow is called and the current row is off the
end of the ResultSet we can't try to load that row because it
doesn't exist and will throw an Exception.

Reported by Prasanth.
2005-04-22 14:36:48 +00:00
Kris Jurka
e1d55f7917 When positioned before the start of a ResultSet issuing relative(0)
results in an exception being thrown when it really should be a
no-op.
2005-04-18 18:25:11 +00:00
Kris Jurka
ce69fa9768 Fix mapping infinite timestamp values to arbitrary dates.
Report from Oliver Siegmar.
2005-01-13 14:22:23 +00:00
Kris Jurka
d06384c6d7 Correctly cast the return value of a CallableStatement when getShort
is called.  getByte presents a can't happen situation as no function
can return a TINYINT because pg doesn't have an equivalent type.
Make this throw an exception if we get to this point.

Thanks to Christian Niles.
2004-10-21 19:13:55 +00:00
Kris Jurka
c65066a190 Protected access to variable m_preparedCount via synchronized
function to prevent multiple threads using automatic cursors on
the same connection from stomping over each others cursor.

Originally Jan Wieck, re-reported by Jack Orenstein after
accidental removal.
2004-09-13 08:02:41 +00:00
Kris Jurka
5e8046cbc9 ResultSet.moveToCurrentRow was checking the cached updateability flag
assuming it had been set instead of correctly calling the
isUpdateable() method which sets the flag if needed.  This usually
worked because moveToCurrentRow is only useful after a
moveToInsertRow call which would set the flag, but this is not
required.

David Bucciarelli
2004-09-13 07:14:26 +00:00
Kris Jurka
c595a438bc New build for the 7.4.4 release. 2004-08-13 05:18:45 +00:00
Kris Jurka
8120dc536a Decode V3 notice messages instead of leaving them in raw form.
From Donald Fraser.
2004-08-11 06:56:00 +00:00
Kris Jurka
af8e9a44fe DatabaseMetaData.getSearchString escape was a \ short of working
because both Java's String constructor and pg's input parser strip
off backslashes.
2004-08-11 06:40:16 +00:00
Kris Jurka
7b2c575d4e When retrieving an array of numerics it attempted to set the scale on
the retrieved data to zero, which doesn't work for non-integer values.

Oliver Dauben
2004-07-15 10:00:20 +00:00
Kris Jurka
46f2ee852b Fix apparently harmless typo. {$srcdir} -> ${srcdir}
Markus Schaber
2004-06-24 09:51:44 +00:00
Kris Jurka
15a932c50f Close the existing socket connection when reverting to the V2
protocol, or encountering other connection failures.

Laurent Sylvain
2004-06-22 09:37:03 +00:00
Kris Jurka
bb95de1f2a Fix some problems with result sets positioned before the start or
after the end of results.  You could still call a number of methods
on them like getXXX, updateXXX, and updateRow().
2004-06-21 03:12:01 +00:00
Kris Jurka
922c2638e4 Fix updatable ResultSets stream methods (ascii, character, binary).
The existing code didn't correctly allocate data arrays, and it
failed to loop when a stream didn't provide the full amount of
data requested of it.

Reported by Jan de Visser.
2004-06-21 02:01:12 +00:00
Kris Jurka
3cec5b804d Foreign key information results should have column name FKTABLE_CAT
instead of FK_TABLE_CAT.

From jeff@bonevich.com.
2004-06-18 05:29:11 +00:00
Kris Jurka
d9a44efc25 Don't throw an Exception in locatorsUpdateCopy() even though the
ability to update LOBs is unimplemented.  The 1.5 JDK's CachedRowSet
implementation calls this method regardless of whether large objects
are used or not.
2004-06-16 18:28:45 +00:00
Kris Jurka
94fdcc052a Bump the build number to relase a new version. 2004-06-16 05:23:33 +00:00
Kris Jurka
7e95c30953 When deleteRow() is called on an updateable ResultSet the ResultSet
should be positioned on the previous row.

Reported by Bob Messenger and Chris Pesarchick.
2004-06-16 05:12:13 +00:00
Kris Jurka
0bd656e407 Fix DatabaseMetaData results for determining foreign key
relationships.  Resulting columns from getImportedExportedKeys should
be FKTABLE_SCHEM and PKTABLE_SCHEM, not _SCHEMA.

Per report from jeff@bonevich.com.
2004-06-16 03:36:56 +00:00
Kris Jurka
10a8cc5cc5 Fix setting timestamp values with very early year values, like 2, by
formatting all years with four digits.  Previously 0002-10-30 was
being sent as 2-10-30 which got turned into 2030-02-10.

Per report from oneway_111.
2004-05-17 20:38:56 +00:00
Kris Jurka
e6e814c2b1 Allow public access to radius field to match other geometric types
behavior.

Per report from Declan Lynch.
2004-05-07 05:28:22 +00:00
Kris Jurka
79e42a6eb2 Update the build.xml file to support building with the new 1.5 jdk
and ant 1.6.
2004-04-26 08:28:32 +00:00
Kris Jurka
1a60128573 Allow updateable ResultSets to support types that aren't directly
mappable to Java types, for example cidr.

Per report from Moray Taylor.
2004-04-24 01:54:45 +00:00
Barry Lind
28455721ff Fix for bug with the jdbc driver not properly working with binary cursors and
the V3 protocol.
 Modified Files:
  Tag: REL7_4_STABLE
 	jdbc/org/postgresql/Driver.java.in
 	jdbc/org/postgresql/core/BaseResultSet.java
 	jdbc/org/postgresql/core/BaseStatement.java
 	jdbc/org/postgresql/core/Field.java
 	jdbc/org/postgresql/core/PGStream.java
 	jdbc/org/postgresql/core/QueryExecutor.java
 	jdbc/org/postgresql/jdbc1/AbstractJdbc1DatabaseMetaData.java
 	jdbc/org/postgresql/jdbc1/AbstractJdbc1ResultSet.java
 	jdbc/org/postgresql/jdbc1/AbstractJdbc1Statement.java
 	jdbc/org/postgresql/jdbc1/Jdbc1CallableStatement.java
 	jdbc/org/postgresql/jdbc1/Jdbc1PreparedStatement.java
 	jdbc/org/postgresql/jdbc1/Jdbc1RefCursorResultSet.java
 	jdbc/org/postgresql/jdbc1/Jdbc1ResultSet.java
 	jdbc/org/postgresql/jdbc1/Jdbc1Statement.java
 	jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java
 	jdbc/org/postgresql/jdbc2/Array.java
 	jdbc/org/postgresql/jdbc2/Jdbc2CallableStatement.java
 	jdbc/org/postgresql/jdbc2/Jdbc2PreparedStatement.java
 	jdbc/org/postgresql/jdbc2/Jdbc2RefCursorResultSet.java
 	jdbc/org/postgresql/jdbc2/Jdbc2ResultSet.java
 	jdbc/org/postgresql/jdbc2/Jdbc2Statement.java
 	jdbc/org/postgresql/jdbc3/AbstractJdbc3ResultSet.java
 	jdbc/org/postgresql/jdbc3/Jdbc3CallableStatement.java
 	jdbc/org/postgresql/jdbc3/Jdbc3PreparedStatement.java
 	jdbc/org/postgresql/jdbc3/Jdbc3RefCursorResultSet.java
 	jdbc/org/postgresql/jdbc3/Jdbc3ResultSet.java
 	jdbc/org/postgresql/jdbc3/Jdbc3Statement.java
 	jdbc/org/postgresql/test/jdbc2/Jdbc2TestSuite.java
 	jdbc/org/postgresql/test/jdbc2/OID74Test.java
 Added Files:
  Tag: REL7_4_STABLE
 	jdbc/org/postgresql/test/jdbc2/ServerCursorTest.java
2004-03-29 17:47:47 +00:00
Kris Jurka
926fd43d77 Update build number in anticipation of 7.4.2 release. With no
currently outstanding issues we'll flag now, so the release doesn't
slip out the door without it.
2004-03-04 03:25:10 +00:00
Kris Jurka
935e6e502d Closing a Connection or Statement object twice should be a no-op
instead of throwing an Exception.

Per report from Victor Sergienko.
2004-02-24 13:11:45 +00:00
Kris Jurka
24bd490369 Don't try to turn the random bytes from a md5 salt into a String
because it may not be a valid String depending on the encoding.

Per report from Nadeem Bitar.
2004-02-10 01:58:48 +00:00
Kris Jurka
932001350b V3 NotificationResonse messages were trying to be received as V2
messages.  Also the PID was being read in the wrong byte order.
Finally add a test case for listen/notify.

Per report from Hans Nather.
2004-02-03 05:43:24 +00:00
Kris Jurka
d71188860e ConnectionPool and SimpleDataSource are marked Serializable, but their
superclass (which contains a number of state variables) is not.  To
correctly serialize these objects we need to manually implement
writeObject and readObject.

Per report from R. Lemos
2004-02-03 05:28:17 +00:00
Kris Jurka
1a92a4c10c ResultSet.next() and previous() incremented or decremented the
internal current_row variable regardless of wether they succeeded or
not.  This generated some ArrayIndexOutOfBoundsExceptions when the
errorneous adjustment current_row led to out of range values.

Per report from Fischer Krisztian.
2004-02-03 05:25:38 +00:00
Kris Jurka
9287630fbc Fix the setXXXStream methods. If passed a null InputStream, convert
this to a setNull call.  The code originally would try to read the
whole stream in one call to read(), but this doesn't work.  The
InputStream API makes it clear you must be prepared to loop and
continue reading if you didn't get the whole request on the first
try.

Per report from Martin Holz.
2004-02-03 05:13:56 +00:00
Kris Jurka
7ca2bff95f Newer versions of the 1.4.2 jdk give warnings about having return in a
finally clause.
2004-02-03 05:00:21 +00:00
Peter Eisentraut
6a78eecf6f Translation updates 2004-01-07 17:44:07 +00:00
Peter Eisentraut
0658e7905d Translation updates 2004-01-05 19:15:55 +00:00
Dave Cramer
757a328d0e patch for new OID74Test 2003-12-18 04:18:15 +00:00
Dave Cramer
1d37f8e288 backpatch for OID74Test to conform with jdbc tests 2003-12-18 04:10:12 +00:00
Dave Cramer
6096a72a54 backpatch for rs.previous from Kris Jurka, reported by Andrew Fyfe 2003-12-18 03:35:55 +00:00
Dave Cramer
2864c18ee5 patch for building for an alternate port 2003-12-18 03:32:05 +00:00
Dave Cramer
b304212560 back patch by Kris Jurka to get the correct protocol version from the server 2003-12-18 03:29:12 +00:00
Dave Cramer
0323e570af back patching fix for compat 7.1 binary stream issues with the new protocol
added test for same
2003-12-17 15:48:40 +00:00
Dave Cramer
dbc5177883 patch for returning database metadata as system objects from Kris Jurka 2003-12-13 00:59:19 +00:00
Dave Cramer
b47863bcd6 add missing SQLState by Patrick Higgins 2003-12-12 18:39:01 +00:00
Dave Cramer
2712da556a cancel row updates sets values to null by Kris Jurka 2003-12-12 18:38:19 +00:00
Dave Cramer
31769dcb02 patch to indicate why test cases failed from Oliver Jowett 2003-12-12 18:37:06 +00:00
Dave Cramer
2fdcd1aaac fix casting pooled connections to PGStatement problem patch by JariP 2003-12-12 18:06:25 +00:00
Dave Cramer
26c89c312b patch to build under jdk1.1 from Richard Scranton 2003-12-12 17:59:08 +00:00