Commit Graph

646 Commits

Author SHA1 Message Date
Bob Weinand
f614fc6898 Fix bug #66015 by reverting "Removed operations on constant arrays." 2014-04-11 10:08:44 +02:00
Nikita Popov
eaf44ec397 Remove some usages of hashtable internals 2014-04-09 12:31:21 +02:00
Daniel Lowrey
2ee4c987e6 Support async pgsql connections and non-blocking queries
- New functions (each accepts a pgsql $connection resource):

  . pg_connect_poll
  . pg_socket
  . pg_consume_input
  . pg_flush

- Modified functions

  The following functions now additionally return zero if the
  underlying socket is set to non-blocking mode and the send
  operation does not complete immediately. Previously these
  functions returned only boolean TRUE/FALSE and blocked
  execution while polling until all data was sent:

  . pg_send_execute
  . pg_send_prepare
  . pg_send_query
  . pg_send_query_params

- New constants

  Used with pg_connect() to initiate an asynchronous connection
  attempt:

  . PGSQL_CONNECT_ASYNC

  Used with pg_connection_status() to determine the current state
  of an async connection attempt:

  . PGSQL_CONNECTION_STARTED
  . PGSQL_CONNECTION_MADE
  . PGSQL_CONNECTION_AWAITING_RESPONSE
  . PGSQL_CONNECTION_AUTH_OK
  . PGSQL_CONNECTION_SSL_STARTUP
  . PGSQL_CONNECTION_SETENV

  Used with pg_connect_poll() to determine the result of an
  async connection attempt:

  . PGSQL_POLLING_FAILED
  . PGSQL_POLLING_READING
  . PGSQL_POLLING_WRITING
  . PGSQL_POLLING_OK
  . PGSQL_POLLING_ACTIVE

- Polling via returned pg_socket() stream

  pg_socket() returns a read-only socket stream that may be
  cast to a file descriptor for select (and similar) polling
  operations. Blocking behavior of the pgsql connection socket
  can be controlled by calling stream_set_blocking() on the
  stream returned by pg_socket().
2014-03-17 06:31:15 -06:00
Anatol Belski
6877af3f71 simplify the metadata part 2014-02-17 10:20:36 +01:00
Yasuo Ohgaki
d8aa130296 Imprement FR #25854 Return value for pg_insert should be resource instead of bool 2014-02-17 06:36:54 +09:00
Yasuo Ohgaki
5fd6365c77 Implement FR #41146 - Add "description" with exteneded flag pg_meta_data().
pg_meta_data(resource $conn, string $table [, bool extended])
It also made pg_meta_data() return "is enum" always.
2014-02-17 06:24:10 +09:00
Yasuo Ohgaki
56854511d8 EXPERIMENTAL flags for pg_select/pg_insert/pg_update/pg_delete are removed.
Use string escape for exotic types that allows to handle any data types. i.e. Array, JSON, JSONB, etc will work.
Add escape only query for better performance which removes meta data look up. Limitations forced by pg_convert() can be avoided with this. PGSQL_DML_ESCAPE constant is added for it.
2014-02-16 14:11:21 +09:00
Yasuo Ohgaki
3f4134c00c Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fixed possbile injections against pg_insert()/pg_delete()/pg_update()/pg_select()
2014-02-16 10:47:32 +09:00
Yasuo Ohgaki
3fcdecf658 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Fixed possbile injections against pg_insert()/pg_delete()/pg_update()/pg_select()
2014-02-16 10:45:50 +09:00
Yasuo Ohgaki
f275fdcf00 Fixed possbile injections against pg_insert()/pg_delete()/pg_update()/pg_select() 2014-02-16 10:45:15 +09:00
Yasuo Ohgaki
a12c896dba Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Refactor build_tablename()
2014-02-16 07:52:00 +09:00
Yasuo Ohgaki
f9537c2a0b Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Refactor build_tablename()
2014-02-16 07:51:50 +09:00
Yasuo Ohgaki
6f14b5ab41 Refactor build_tablename() 2014-02-16 07:51:27 +09:00
Yasuo Ohgaki
53f34bca76 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Revise encoding blacklist
2014-02-16 06:25:15 +09:00
Yasuo Ohgaki
8c9fd8fb53 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Revise encoding blacklist
2014-02-16 06:25:01 +09:00
Yasuo Ohgaki
9f251548ae Revise encoding blacklist 2014-02-16 06:21:39 +09:00
Felipe Pena
8cec20a565 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  - Fix ZTS build when HAVE_PQESCAPELITERAL is not set
  Update NEWS
  Update NEWS
2014-02-15 11:05:25 -02:00
Felipe Pena
a65a546640 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  - Fix ZTS build when HAVE_PQESCAPELITERAL is not set
  Update NEWS
2014-02-15 11:05:08 -02:00
Felipe Pena
9d84f6c06e - Fix ZTS build when HAVE_PQESCAPELITERAL is not set 2014-02-15 11:04:49 -02:00
Yasuo Ohgaki
5ff9089aeb Merge branch 'PHP-5.5' into PHP-5.6 2014-02-15 18:30:11 +09:00
Yasuo Ohgaki
6e0b8b4288 Merge branch 'PHP-5.4' into PHP-5.5 2014-02-15 18:29:36 +09:00
Yasuo Ohgaki
832c21cabf Refactor and cleanup. WS is cleaned up. Use -b if it is needed.
Added compatibility macros, PQescapeStringConn, PGSQLescapeLiteral/Identifier, PGSQLfree.
2014-02-15 18:20:58 +09:00
Anatol Belski
4247f624cb Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  fixed missing usleep() prototype in pgsql
2014-01-22 11:53:56 +01:00
Anatol Belski
e67ef24227 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  fixed missing usleep() prototype in pgsql
2014-01-22 11:53:32 +01:00
Anatol Belski
7bcf01f39a fixed missing usleep() prototype in pgsql 2014-01-22 11:52:52 +01:00
Yasuo Ohgaki
28be6aea9c Added pg_lo_truncate() and 64bit large object support from PostgreSQL 9.3 and up 2014-01-15 14:37:24 +09:00
Yasuo Ohgaki
c58329fccc Always initialize pg_version() result array elements to prevent failed test with older postgresql servers. Add missing client_encoding element. 2014-01-15 14:27:33 +09:00
Yasuo Ohgaki
d0924c2500 Fixed pg_version() crash with older postgresql 2014-01-15 13:32:15 +09:00
Yasuo Ohgaki
58dff7cee5 Made pg_version() return full connection info. 2014-01-14 10:10:48 +09:00
Xinchen Hui
c081ce628f Bump year 2014-01-03 11:08:10 +08:00
Xinchen Hui
47c9027772 Bump year 2014-01-03 11:06:16 +08:00
Xinchen Hui
c0d060f5c0 Bump year 2014-01-03 11:04:26 +08:00
Yasuo Ohgaki
6af3683a4c Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Fix Coverity issue reporting wrong sizeof()
2013-10-22 12:29:01 +09:00
Yasuo Ohgaki
1f5b1cfb2b Fix Coverity issue reporting wrong sizeof() 2013-10-22 12:27:18 +09:00
Matteo Beccati
908da14bd1 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Fixed other compiler warnings
2013-08-22 15:34:11 +02:00
Matteo Beccati
d5987478a8 Fixed other compiler warnings 2013-08-22 15:33:54 +02:00
Matteo Beccati
4283f75c34 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Fixed compiler warnings in ext/pgsql
  Fixed other compiler warnings in PDO_PGSQL
  Fixed compiler warning
2013-08-21 11:24:27 +02:00
Matteo Beccati
540f325664 Fixed compiler warnings in ext/pgsql 2013-08-21 11:24:12 +02:00
Anatol Belski
bab33f7e05 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  removed unused vars
2013-08-12 15:52:50 +02:00
Anatol Belski
72aacbf735 removed unused vars 2013-08-12 15:52:15 +02:00
Anatol Belski
87198989cd Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  fixed strndup usage in the pgsql ext
2013-08-12 15:45:26 +02:00
Anatol Belski
4134ebec8e fixed strndup usage in the pgsql ext 2013-08-12 15:44:47 +02:00
Yasuo Ohgaki
cb8d1fc7f9 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Fixed bug #62978. pg_select()/etc may allow SQL injection when table name is user parameter, users are able to control table names.
2013-08-05 18:24:07 +09:00
Yasuo Ohgaki
f718684a6c Fixed bug #62978. pg_select()/etc may allow SQL injection when table name is user parameter, users are able to control table names. 2013-08-05 18:23:15 +09:00
Yasuo Ohgaki
ef3d813d2c Fixed bug #65336 2013-07-27 05:54:33 +09:00
Yasuo Ohgaki
1d7b6970f2 Fixed bug #65336 2013-07-27 05:54:09 +09:00
Veres Lajos
4749457a49 HASH_KEY_NON_EXISTANT fix 2013-07-21 20:09:53 -07:00
Yasuo Ohgaki
002f3ff4dc Inprove pg_unescape_bytea() error message 2013-07-13 06:05:17 +09:00
Yasuo Ohgaki
2bc8271b29 Add warning to pg_unescape_bytea() when invalid parameter is passed 2013-07-08 18:51:37 +09:00
Andrey Hristov
781be5f1d7 Merge branch 'PHP-5.4' into PHP-5.5
Conflicts:
	NEWS
2013-06-26 16:50:08 +02:00
Yasuo Ohgaki
6c8cef3ca4 Fixed bug #65015 (pg_send_query does not flush send buffer) patch submitted by: adam at vektah dot net 2013-06-26 16:17:57 +09:00
Matteo Beccati
d5a1c0cae2 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Fixed bug #64609 (pg_convert enum type support)
2013-06-02 06:34:05 +02:00
Matteo Beccati
51c065f611 Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  Fixed bug #64609 (pg_convert enum type support)
2013-06-02 06:33:54 +02:00
Matteo Beccati
25aae37229 Fixed bug #64609 (pg_convert enum type support) 2013-06-02 06:29:35 +02:00
Lars Strojny
92965b033a Bug #46408: Fix double formatting for PostgreSQL bound parameters 2013-01-14 21:23:52 +01:00
Xinchen Hui
a666285bc2 Happy New Year 2013-01-01 16:37:09 +08:00
Xinchen Hui
0a7395e009 Happy New Year 2013-01-01 16:28:54 +08:00
Xinchen Hui
a2045ff332 Happy New Year~ 2013-01-01 16:02:16 +08:00
Yasuo Ohgaki
655245afef add pg_escape_identifier/pg_escape_literal 2012-04-19 13:40:24 -07:00
Yasuo Ohgaki
cce0f8e507 Implement Request #47570 libpq's PG_VERSION should be exported to userland 2012-04-18 12:20:35 +02:00
Yasuo Ohgaki
417e9cfe1b Implement Request #47570 libpq's PG_VERSION should be exported to userland 2012-04-17 16:35:24 +09:00
Yasuo Ohgaki
48033ed48d Merge branch 'PHP-5.4'
* PHP-5.4:
  Fixed bug #60718 Complie problem with libpq (PostgreSQL 7.3 or less)
2012-03-29 20:06:00 +09:00
Yasuo Ohgaki
8449e0ca89 Fixed bug #60718 Complie problem with libpq (PostgreSQL 7.3 or less) 2012-03-29 20:04:15 +09:00
Yasuo Ohgaki
aecf5485e3 Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  Fixed bug #60718 Complie problem with libpq (PostgreSQL 7.3 or less)
2012-03-29 19:55:06 +09:00
Yasuo Ohgaki
931831bf75 Fixed bug #60718 Complie problem with libpq (PostgreSQL 7.3 or less) 2012-03-29 19:48:58 +09:00
Felipe Pena
e4ca0ed09f - Year++ 2012-01-01 13:15:04 +00:00
Felipe Pena
8775a37559 - Year++ 2012-01-01 13:15:04 +00:00
Felipe Pena
4e19825281 - Year++ 2012-01-01 13:15:04 +00:00
Yasuo Ohgaki
77d11b4959 add pg_escape_identifier/pg_escape_literal 2011-11-25 02:21:01 +00:00
Ilia Alshanetsky
32c4c239c0 Fixed bug #60244 (pg_fetch_* functions do not validate that row param is >0). 2011-11-15 18:02:58 +00:00
Ilia Alshanetsky
b6530d8978 Fixed bug #60244 (pg_fetch_* functions do not validate that row param is >0). 2011-11-15 18:02:58 +00:00
Ilia Alshanetsky
4cf3c8c558 Fixed bug #60244 (pg_fetch_* functions do not validate that row param is >0). 2011-11-15 18:02:58 +00:00
Felipe Pena
23e438594d - Make usage of new PHP_FE_END macro 2011-07-25 11:42:53 +00:00
Felipe Pena
4b30846b50 - Make usage of new PHP_FE_END macro 2011-07-25 11:35:02 +00:00
Felipe Pena
da376383e8 - Make usage of new PHP_FE_END macro 2011-07-25 11:35:02 +00:00
Pierre Joye
9805e1674a - remove magic quotes support, functions are kept (see the NEWS entry for the details) for BC reasons but do not allow to set enable MQ 2011-07-22 11:25:30 +00:00
Pierre Joye
cc1c7af037 - remove magic quotes support, functions are kept (see the NEWS entry for the details) for BC reasons but do not allow to set enable MQ 2011-07-22 11:25:30 +00:00
Felipe Pena
32b5f8a1a3 - Added new parameter parsing option (p - for valid path (string without null byte in the middle))
# The tests will be fixed in the next commits
2011-06-06 21:28:16 +00:00
Felipe Pena
4737910b69 - Added new parameter parsing option (p - for valid path (string without null byte in the middle))
# The tests will be fixed in the next commits
2011-06-06 21:28:16 +00:00
Ilia Alshanetsky
46ff954ca7 Added support for "extra" parameter for PGNotify(). 2011-01-27 16:02:30 +00:00
Felipe Pena
927bf09c29 - Year++ 2011-01-01 02:19:59 +00:00
Felipe Pena
0203cc3d44 - Year++ 2011-01-01 02:17:06 +00:00
Pierre Joye
ce96fd6b07 - fix #39863, do not accept paths with NULL in them. See http://news.php.net/php.internals/50191, trunk will have the patch later (adding a macro and/or changing (some) APIs. Patch by Rasmus 2010-11-18 15:22:22 +00:00
Felipe Pena
996f45b688 - Fixed bug #47199 (pg_delete() fails on NULL)
patch by: ewgraf at gmail dot com
2010-11-06 17:43:25 +00:00
Felipe Pena
ccfe9c30aa - Fixed bug #47199 (pg_delete() fails on NULL)
patch by: ewgraf at gmail dot com
2010-11-06 17:43:25 +00:00
Pierre Joye
aa0ed267a2 - use TSRMLS_*C instead of TSRMLS_FETCH in zend_list_insert 2010-09-16 09:13:19 +00:00
Raphael Geissert
174d2528b1 Fix typos s/connnection/connection 2010-05-01 18:27:42 +00:00
Raphael Geissert
59fa776c53 Fix typos s/connnection/connection 2010-05-01 18:27:42 +00:00
Kalle Sommer Nielsen
dd8e59da8f Removed safe_mode
* Removed ini options, safe_mode*
 * Removed --enable-safe-mode --with-exec-dir configure options on Unix
 * Updated extensions, SAPI's and core
 * php_get_current_user() is now declared in main.c, thrus no need to include safe_mode.h anymore
2010-04-26 23:53:30 +00:00
Felipe Pena
1efc049863 - Fixed bug #51607 (pg_copy_from does not allow schema in the tablename argument)
Patch by: cbandy at jbandy dot com
2010-04-20 15:59:01 +00:00
Felipe Pena
b7bd1167a9 - Fixed bug #51607 (pg_copy_from does not allow schema in the tablename argument)
Patch by: cbandy at jbandy dot com
2010-04-20 15:59:01 +00:00
Felipe Pena
5aedea7179 - Fixed bug #51609 (pg_copy_to: Invalid results when using fourth parameter) 2010-04-20 14:11:53 +00:00
Felipe Pena
8c14acfc82 - Fixed bug #51609 (pg_copy_to: Invalid results when using fourth parameter) 2010-04-20 14:11:53 +00:00
Felipe Pena
0b401e1289 - Fixed bug #51608 (pg_copy_to: WARNING: nonstandard use of \\ in a string literal)
Patch by: cbandy at jbandy dot com
2010-04-20 11:49:23 +00:00
Felipe Pena
f507cc9cf6 - Fixed bug #51608 (pg_copy_to: WARNING: nonstandard use of \\ in a string literal)
Patch by: cbandy at jbandy dot com
2010-04-20 11:49:23 +00:00
Hannes Magnusson
3f15f8f4e3 Fix build (see r296062) 2010-03-11 19:50:04 +00:00
Sebastian Bergmann
9ba1e81665 sed -i "s#1997-2009#1997-2010#g" **/*.c **/*.h **/*.php 2010-01-03 09:23:27 +00:00
Ilia Alshanetsky
eae259b7ea Fixe build 2009-11-27 03:02:01 +00:00
Ilia Alshanetsky
23f4da9113 Fixed bug #50195 (pg_copy_to() fails when table name contains schema). 2009-11-25 14:28:00 +00:00
Ilia Alshanetsky
03ddb4f2b5 Fixed compiler warnings 2009-11-02 13:33:24 +00:00
Kalle Sommer Nielsen
01fc4ed1d6 MFH: Fix compiler warnings 2009-05-19 16:03:36 +00:00
Ilia Alshanetsky
8610935eac Fixed bug #47639 (pg_copy_from() WARNING: nonstandard use of \\ in a string
literal)
2009-03-12 22:53:16 +00:00
Felipe Pena
e77326faba - MFH: Fixed bug #47048 (Segfault with new pg_meta_data) 2009-01-18 23:49:31 +00:00
Ilia Alshanetsky
dfa86ccf73 Improved parameter handling 2009-01-13 19:08:08 +00:00
Sebastian Bergmann
08659c2dcd MFH: Bump copyright year, 3 of 3. 2008-12-31 11:15:49 +00:00
Dmitry Stogov
7d4fd3fd38 Fixed bug #46409 (__invoke method called outside of object context when using array_map) 2008-11-27 19:01:23 +00:00
Felipe Pena
fc2fb50d09 - MFH: Added 'static' into ZEND_BEGIN_ARG_INFO_EX macro 2008-11-17 11:28:01 +00:00
Felipe Pena
7a37fa2d6b - Revert ZEND_BEGIN_ARG_INFO change 2008-11-02 21:19:39 +00:00
Felipe Pena
df10005563 - MFH: Added 'static' into ZEND_BEGIN_ARG_INFO_EX macro 2008-10-24 14:35:40 +00:00
Felipe Pena
8563497a94 MFH:
- Fixed:
  . Memory leak in pg_delete() when using PGSQL_DML_STRING.
  . Bug #24679 (pg_insert problem!)
  . Bug #35996 (pg_meta_data should take the schema into account)
  . Bug #40808 (pg_insert problem)
  . Bug #42078 (pg_meta_data mix tables metadata from different schemas)
- Improved:
  . Error messages
- Added:
  . Tests
2008-10-16 00:39:31 +00:00
Felipe Pena
30173a8ec8 - Fixed possible efree(NULL) 2008-10-15 13:34:26 +00:00
Felipe Pena
310ac30e5a MFH:
- Fixed bug #37100 (data is returned truncated with BINARY CURSOR)
  Patch by Tony
2008-10-13 13:44:32 +00:00
Ilia Alshanetsky
529105427e use proper macro 2008-10-08 23:04:38 +00:00
Ilia Alshanetsky
fdcdf8c02b Fixed bug #46206 (pg_query_params/pg_execute convert passed values to
strings).
2008-10-01 20:30:23 +00:00
Ilia Alshanetsky
b3bbaf7d06 Fixed unused var warning 2008-09-10 01:39:35 +00:00
Felipe Pena
0c745885ca - Fixed some wrong format parameters 2008-09-08 01:33:08 +00:00
Jani Taskinen
b17dc14f18 MFH: nuketh C++ comments 2008-08-03 12:15:55 +00:00
Dmitry Stogov
691d4a6999 Fixed uninitialised data 2008-07-25 08:23:07 +00:00
Hartmut Holzgraefe
432b57b2ae added support for object ids in pg_lo_create() and pg_lo_import() where available
(based on code provided by Tatsuo Ishii)
2008-07-23 00:17:19 +00:00
Felipe Pena
01a35a058f - Added arginfo 2008-07-02 00:10:54 +00:00
Felipe Pena
69e3fc8782 - New parameter parsing API 2008-06-29 22:38:55 +00:00
Ilia Alshanetsky
01da46b1bb Fixed bug #45004 (pg_insert() does not accept 4 digit timezone format) 2008-05-19 15:16:47 +00:00
Sebastian Bergmann
d1dded8751 MFH: Bump copyright year, 2 of 2. 2007-12-31 07:17:19 +00:00
Ilia Alshanetsky
969f81a49e Fixed bug #43041 (micro-optimizations in pgsql data retrieval) Initial patch
by andy at petdance dot com
2007-11-22 00:17:28 +00:00
Ilia Alshanetsky
37b3d701e3 Fixed bug #43279 (pg_send_query_params() converts all elements in 'params'
to strings)
2007-11-13 20:05:47 +00:00
Jani Taskinen
aa3eee1dce MFH:- Moved the old regex functions to own extension: ereg 2007-10-05 15:00:09 +00:00
Ilia Alshanetsky
f6b761b0ac Fixed bug #42783 (pg_insert() does not accept an empty list for insertion) 2007-10-03 23:30:46 +00:00
Dmitry Stogov
6c810b0d4c Improved memory usage by movig constants to read only memory. (Dmitry, Pierre) 2007-09-27 18:00:48 +00:00
Ilia Alshanetsky
49c91f6e33 MFH: fixed typo in function name 2007-09-05 13:03:59 +00:00
Ilia Alshanetsky
59a410cb76 Fixed bug #42506 (php_pgsql_convert() timezone parse bug) 2007-09-03 15:36:04 +00:00
Ilia Alshanetsky
f30f2ef733 Fixed bug #42368 (Incorrect error message displayed by pg_escape_string). 2007-08-22 22:40:29 +00:00
Ilia Alshanetsky
adcfdf7fa4 Fixed bug #41845 (pgsql extension does not compile with PostgreSQL <7.4) 2007-07-02 15:37:43 +00:00
Marcus Boerger
50ea26760d - Avoid sprintf, even when checked copy'n'paste or changes lead to errors 2007-02-24 02:17:47 +00:00
Ilia Alshanetsky
a471f75354 Simplify code by converting emalloc() + sprintf() to spprintf() 2007-02-23 00:37:36 +00:00
Antony Dovgal
870bd0b99f MFH 2007-01-11 16:45:37 +00:00
Ilia Alshanetsky
5babb6d10d Fixed bug #39979 (PGSQL_CONNECT_FORCE_NEW will causes next connect to
establish a new connection).
2007-01-07 04:36:40 +00:00
Ilia Alshanetsky
7d901eacbe %f -> %F 2007-01-05 15:06:55 +00:00
Sebastian Bergmann
4223aa4d5e MFH: Bump year. 2007-01-01 09:36:18 +00:00
Ilia Alshanetsky
79d524dc1e Fixed bug #39971 (pg_insert/pg_update do not allow now() to be used for
timestamp fields).
2006-12-29 00:34:30 +00:00
Ilia Alshanetsky
794845234e Added buffer length checks 2006-12-28 15:21:21 +00:00
Ilia Alshanetsky
52d53543ac Allocation safety checks 2006-12-25 22:36:57 +00:00
Ilia Alshanetsky
bfa4af46e1 Fixed bug #39663 (Memory leak in pg_get_notify() and a possible memory
corruption on Windows in pgsql and pdo_pgsql extensions).
2006-11-29 15:45:59 +00:00
Ilia Alshanetsky
b28cbe8b6f Fixed bug #36812 (pg_execute() modifies input array). 2006-11-13 22:10:37 +00:00
Ilia Alshanetsky
fab29dcbcf Make pg_escape_bytea() use PQescapeByteaConn() whenever possible. 2006-10-06 21:45:10 +00:00
Hannes Magnusson
93909bb30e - nuke unused variable
- "prefer" two arguments
- only print "wrong parameter count" once
2006-10-05 16:02:29 +00:00
Ilia Alshanetsky
e8c70bfa99 Added support for character sets in pg_escape_string() for PostgreSQL
8.1.4 and higher.
2006-10-04 23:27:03 +00:00
Hannes Magnusson
9bff1e24b5 pg_send_prepare(), pg_send_query_params() & pg_send_execute() do not throw "Wrong parameter count" 2006-10-03 15:21:47 +00:00
Ilia Alshanetsky
2cc1f53f3b Added a check for PQftable() function 2006-09-15 19:47:50 +00:00
Antony Dovgal
37635d93e6 fix leak in pg_copy_to() when invalid resource was passed 2006-09-06 12:40:56 +00:00
Dmitry Stogov
1dbaae2795 Added automatic module globals management 2006-06-15 18:33:09 +00:00
Marcus Boerger
77c1b56cd7 - Update after api changes 2006-05-10 00:00:13 +00:00
Edin Kadribasic
18eb480dd2 MFH: Added pg_field_table() as per req: #36750 2006-05-07 00:28:32 +00:00
Marcus Boerger
8bbf3a00dc - MFH Fix potenbtioal SEGV 2006-04-10 19:51:55 +00:00
Yasuo Ohgaki
cdbe8b4fd8 reenable pg_execute E_WARNING 2006-03-28 00:28:02 +00:00
Yasuo Ohgaki
82376269fd remove pg_execute() E_WARNING error when query plan is not defined 2006-03-27 02:59:55 +00:00
Marcus Boerger
0bcd459300 - bug #36625 fix 2006-03-13 22:56:20 +00:00
Antony Dovgal
0b12f7307e MFH: fix #36606 (pg_query_params() changes arguments type to string) 2006-03-05 13:35:52 +00:00
foobar
5bd93221a8 bump year and license version 2006-01-01 12:51:34 +00:00
Marcus Boerger
81c25d8700 - Get rid of compiler warnings (both postgres an dphp use these defines) 2005-12-20 21:10:43 +00:00
foobar
3e669bc950 MFH: nuke php3 legacy 2005-12-06 02:28:41 +00:00
foobar
a3af52c11e MFH: list_entry -> zend_rsrc_list_entry 2005-12-05 23:38:04 +00:00
Marcus Boerger
ae1d56d098 - MFH Bug #32223 weird behaviour of pg_last_notice 2005-11-07 12:57:49 +00:00
Marcus Boerger
71ad4dd19b - Fix parameter parsing 2005-11-06 11:58:34 +00:00
Ilia Alshanetsky
ea4734926e MFH: Fixed bug #33167 (Possible crash inside pg_fetch_array()). 2005-10-11 16:19:14 +00:00
Edin Kadribasic
d327027ea9 Use free() instead of PQfreemem() to maintain compabitibility with older
PostgreSQL client libraries (bug #33813).
2005-08-16 09:55:44 +00:00
foobar
23e671a51e - Bumber up year 2005-08-03 14:08:58 +00:00
Ilia Alshanetsky
ef7bd06657 Added pg_fetch_all_columns() function to fetch all values of a column from
a result cursor.
2005-07-08 00:40:32 +00:00
Edin Kadribasic
312a8eede3 Properly detect when the copy command fails 2005-07-05 14:49:22 +00:00
Derick Rethans
17b877a772 - Fixed memory corruption in pg_copy_from() in case the as_null parameter was
passed. (Derick)
2005-07-05 12:45:39 +00:00
Antony Dovgal
fcf14f1795 use & and check for the right value of result_type 2005-05-10 23:12:31 +00:00
Antony Dovgal
38a7ef5fe6 fix #32904 (pg_get_notify() ignores result_type parameter) 2005-05-10 20:13:24 +00:00
Ilia Alshanetsky
bdbce01588 Prevent double free. 2005-05-03 22:50:00 +00:00
Antony Dovgal
2c511712f7 disable pg_cmdtuples() too, if there is no pg_affected_rows() 2005-04-13 22:11:35 +00:00
Derick Rethans
cba30657d9 - MFH43: Fixed bug #32699 (pg_affected_rows() was defined when it was not
available).
2005-04-13 21:48:33 +00:00
Christopher Kings-Lynne
030ebaaa45 (PHP pg_unescape_bytea) Use libpq version of PQunescapeBytea if it exists.
# The version in libpq is newer and faster than the one in PHP, but it is
# necessary for me to add a string copy for freeing purposes.  This copy
# is only needed in Windows AFAIK, how can I detect that?
2005-03-25 06:26:31 +00:00
Ilia Alshanetsky
e8bd3b9b4f Slightly safer code. 2005-03-25 00:30:43 +00:00
Christopher Kings-Lynne
e2b87e6230 Tweak some #if's to be more orthogonal.
(PHP pg_set_error_verbosity) New function to set PostgreSQL error verbosity

(PHP pg_copy_from) Use non-deprecated API if it is available

(PHP pg_copy_to) Use non-deprecated API if it is available
2005-03-22 08:51:23 +00:00
foobar
4d46234912 - Fixed a warning (might also be an error with some exotic compiler) 2005-03-20 02:57:10 +00:00
Christopher Kings-Lynne
721d34bebc Two of the diagnostic definitions were added in 8.0. Add appropriate #ifdefs. 2005-03-20 02:46:02 +00:00
Christopher Kings-Lynne
3dd44c3018 Another oversight - make sure constants related to pg_result_error_field are #if'd as well as the function itself 2005-03-19 09:21:51 +00:00
Christopher Kings-Lynne
28ec3abf87 Minor oversight in #if for an internal function 2005-03-19 09:07:20 +00:00
Christopher Kings-Lynne
1168c30635 Added several new functions to support the PostgreSQL v3 protocol
introduced in PostgreSQL 7.4.

(PHP pg_transaction_status) New function to get in-transaction status of
                            a database connection.

(PHP pg_query_params) New function to allow execution of parameterized
                      queries.

(PHP pg_prepare) New function to allow preparing named queries.

(PHP pg_execute) New function to allow execution of named prepared
                 queries.

(PHP pg_send_query_params) New function that is the async equivalent of
                           pg_query_params.

(PHP pg_send_prepare) New function that is the async equivalent of
                      pg_prepare.

(PHP pg_send_execute) New function that is the async equivalent of
                      pg_execute.

(PHP pg_result_error_field) New function that allows highly detailed
                            error information, most importantly the
                            SQLSTATE error code

# Regression tests are included for all but 2 functions, the rest will
# follow shortly.  Docs will also follow shortly.
2005-03-19 08:46:56 +00:00
Edin Kadribasic
4a133ae725 ws fix 2005-02-14 23:40:24 +00:00
Edin Kadribasic
70e0849416 Added pg_field_type_oid() function 2005-02-14 23:36:16 +00:00
Andi Gutmans
56f8195fe5 - Nuke empty_string. It is a reminanent from the time where RETURN_FALSE()
used to return "" and not bool(false). It's not worth keeping it because
  STR_FREE() and zval_dtor() always have to check for it and it slows down
  the general case. In addition, it seems that empty_string has been abused
  quite a lot, and was used not only for setting zval's but generally in
  PHP code instead of "", which wasn't the intention. Last but not least,
  nuking empty_string should improve stability as I doubt every place
  correctly checked if they are not mistakenly erealloc()'ing it or
  calling efree() on it.
  NOTE: Some code is probably broken. Each extension maintainer should
  check and see that my changes are OK. Also, I haven't had time to touch
  PECL yet. Will try and do it tomorrow.
2004-07-19 07:19:50 +00:00
Ilia Alshanetsky
ca5c6a1e91 Fixed bug #28374 (Possible unterminated loop inside
_php_pgsql_trim_message()).
2004-05-12 16:49:47 +00:00
Ilia Alshanetsky
8694cd135d Fixed possible crash inside pg_copy_(to|from) function if delimiter is more
then 1 character long.
2004-04-22 00:31:55 +00:00
Ilia Alshanetsky
5442d722c3 Fixed bug #27300 (Improved regex for pg_convert()).
# Patch by benjcarson at digitaljunkies dot ca
2004-03-18 01:34:58 +00:00
Marcus Boerger
b83663e0f2 Keep BC of pg_fetch_object 2004-03-15 20:16:59 +00:00
Marcus Boerger
0ace9f4885 Bugfix #27597 pg_fetch_array not returning false . 2004-03-15 19:47:18 +00:00
Ard Biesheuvel
81f05c18f5 Wordsize fixes 2004-02-25 20:16:27 +00:00
Zeev Suraski
30171a7590 zend_default_classes.h -> zend_exceptions.h 2004-02-12 10:43:27 +00:00
Ilia Alshanetsky
194509f093 Fixed bug #27007 (missing connection closure when connect fails in pgsql). 2004-01-29 02:54:30 +00:00
Ilia Alshanetsky
3b7da77480 Fixed bug #26864 (pg_(update|delete) ignore PGSQL_DML_EXEC option). 2004-01-11 21:18:19 +00:00
Andi Gutmans
dbeb4158d2 - A belated happy holidays and PHP 5 2004-01-08 08:18:22 +00:00
Ilia Alshanetsky
57b7eb9dc3 Missing bit for bug #26625. 2003-12-22 15:56:51 +00:00
Ilia Alshanetsky
82ec523a75 Fixed Bug #26625 (pg_convert sets NULL incorrectly for character data
types).
2003-12-16 01:00:34 +00:00
Ilia Alshanetsky
669b421c11 Removed unused variable. 2003-12-07 18:39:09 +00:00
Marcus Boerger
4b9a4509c4 MFB: PHP_PQ_ERROR() change 2003-12-06 21:36:21 +00:00
Edin Kadribasic
32eb4f78c2 Get rid of PHPAPI usage.
Enable shared build in the new php5 build system
Check for the correct header.
2003-12-05 01:03:35 +00:00