Commit Graph

957 Commits

Author SHA1 Message Date
Xinchen Hui
ae122bf7ad Fixed warning of incompatible pointer 2016-01-23 22:49:15 -08:00
Dmitry Stogov
6a2621e3a5 Avoid incomplete zend_internal_function initialization. 2016-01-13 15:06:17 +03:00
Xinchen Hui
36b4311edd Do not edit the value in place (might be relates to #71261) 2016-01-04 05:38:15 -08:00
Lior Kaplan
ed35de784f Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Happy new year (Update copyright to 2016)
2016-01-01 19:48:25 +02:00
Lior Kaplan
49493a2dcf Happy new year (Update copyright to 2016) 2016-01-01 19:21:47 +02:00
Fabian Franz
1fcadf67e6 Fix setting of empty string resource. 2015-11-05 19:47:12 +01:00
Anatol Belski
a80545992b update the actual sql parser file for #70861 2015-11-05 14:46:40 +01:00
Anatol Belski
5c96a91d77 Fix bug #70861 Segmentation fault in pdo_parse_params() during Drupal 8 test suite 2015-11-05 14:46:28 +01:00
Daniel Persson
73384728ca Fix bug #64172
Check if the SQLSTATE error code is equal to PDO_ERR_NONE before we ask the driver.
And if no error is reported skip the extra call to the driver.
2015-10-18 17:06:54 -07:00
Daniel Persson
307c1f6bf0 Fix bug #64172
Check if the SQLSTATE error code is equal to PDO_ERR_NONE before we ask the driver.
And if no error is reported skip the extra call to the driver.
2015-10-18 17:03:39 -07:00
Dmitry Stogov
d82ea930ed Cleanup: removed deprecated commented code. Incorrect zval_dtor() usage replaced by zval_dtor_ptr(). 2015-09-23 01:32:30 +03:00
Xinchen Hui
014abbc840 Merge branch 'PHP-5.6'
Conflicts:
	ext/pdo/pdo_dbh.c
	ext/pdo/php_pdo_driver.h
2015-08-30 05:32:37 -07:00
Xinchen Hui
ef1bd8f0e6 Fixed bug #70389 (PDO constructor changes unrelated variables) 2015-08-30 05:02:38 -07:00
Xinchen Hui
aaf7638706 Fixed bug #70221 (persistent sqlite connection + custom function segfaults) 2015-08-10 19:00:35 +08:00
Christopher Jones
a3c54dd1b7 Add Oracle syntax (Senthil) 2015-07-10 09:47:45 +10:00
Aaron Piotrowski
ed1b64877d Switch position of ce in exception ce variable names 2015-07-03 09:45:03 -05:00
Aaron Piotrowski
a812a74c2e Change zend_exception_get_default() to zend_exception_ce 2015-07-03 09:44:48 -05:00
Dmitry Stogov
4a2e40bb86 Use ZSTR_ API to access zend_string elements (this is just renaming without semantick changes). 2015-06-30 04:05:24 +03:00
Aaron Piotrowski
110e0a5a2c Merge branch 'master' into throwable-interface
# Conflicts:
#	Zend/zend_language_scanner.c
#	Zend/zend_language_scanner.l
#	ext/simplexml/tests/SimpleXMLElement_xpath.phpt
2015-06-14 18:53:11 -05:00
Nikita Popov
b081da657e Expose pdo stmt ctor args to gc
These very commonly contain a reference to the PDO object itself.
2015-05-20 18:28:09 +02:00
Aaron Piotrowski
e97d5fab35 Update exception names in tests after formatting changes. 2015-05-17 17:31:43 -05:00
Nikita Popov
3ae995f03c Tweak uncaught exception message display
This implements a reduced variant of #1226 with just the following
change:

-Fatal error: Uncaught exception 'EngineException' with message 'Call to private method foo::bar() from context ''' in %s:%d
+Fatal error: Uncaught EngineException: Call to private method foo::bar() from context '' in %s:%d

The '' wrapper around messages is very weird if the exception
message itself contains ''. Futhermore having the message wrapped
in '' doesn't work for the "and defined" suffix of
TypeExceptions.
2015-05-17 18:47:06 +02:00
Stanislav Malyshev
2660fb96aa Merge branch 'pull-request/1277'
* pull-request/1277:
  fix typos
2015-05-16 14:20:41 -07:00
Nikita Popov
c9f27ee422 Display EngineExceptions like ordinary exceptions
TypeException stays as-is for now because it uses messages that are
incompatible with the way exception messages are displayed.

closure_038.phpt and a few others now show that we're generating
too many exceptions for compound operations on undefined properties
-- this needs to be fixed in a followup.
2015-05-15 23:40:32 +02:00
olshevskiy87
8bdec7a248 fix typos
Signed-off-by: olshevskiy87 <olshevskiy87@bk.ru>
2015-05-13 22:28:35 +04:00
Dmitry Stogov
70c86732cb Use zend_string to represent pdo_column_data.name and avoid duplication. 2015-05-05 16:19:51 +03:00
Christopher Jones
7ba353ef69 Add unique prefix to exported function 2015-05-02 10:03:30 -07:00
Christopher Jones
be806eba80 Export free_statement to replace php_pdo_stmt_delref which was deleted in 9fe8531309 along with php_pdo_stmt_addref 2015-05-01 18:17:34 -07:00
Dmitry Stogov
15a5f61cf4 Use fast method to check if first arguments should be passed by reference (not tested onbig endian). 2015-04-22 21:46:13 +03:00
Nikita Popov
6202e2860d Fix leak of Pdo object if query() fails
Decref the DBH object when storing the errored query statement --
the DBH owns the stmt, so it will live long enough.
2015-04-16 21:08:29 +02:00
Nikita Popov
32ab26182b Fix leak of FETCH_INTO object 2015-04-16 21:08:29 +02:00
Nikita Popov
3d7959c87b Fix PdoRow leak
PdoStatement should only hold a weakref to the PdoRow.
2015-04-16 21:08:29 +02:00
Nikita Popov
caf9219dea Fix EH_THROW replacement in PDO constructor
Needs to happen for the "goto options" case as well, otherwise
will try to restore error handling that was never replaced.
2015-04-06 12:15:04 +02:00
Nikita Popov
122d759618 Always throw TypeException on throwing zpp failures
Introduces a ZEND_PARSE_PARAMS_THROW flag for zpp, which forces to
report FAILURE errors using a TypeException instead of a Warning,
like it would happen in strict mode.

Adds a zend_parse_parameters_throw() convenience function, which
invokes zpp with this flag.

Converts all cases I could identify, where we currently have
throwing zpp usage in constructors and replaces them with this API.
Error handling is still replaced to EH_THROW in some cases to handle
other, domain-specific errors in constructors.
2015-04-06 11:27:34 +02:00
Nikita Popov
30d59aed1c Try fixing PDO MySQL pconnect test
Use less aggressive conversion to exceptions, in particular
do not convert warnings that happen during check_liveness. If the
server has gone away this will just reconnect and we still end up
with a valid connection, so it shouldn't throw.

Also drop some unnecessary checks for malloc returning NULL.
2015-04-04 16:00:17 +02:00
Dmitry Stogov
ea09a9fa32 Convert fatal errors into EngineExceptions
Make zval_update_constant_ex(), zval_update_constant(), zend_update_class_constants() and zend_ast_evaluate() return SUCCESS or FAILURE.
2015-04-02 02:05:25 +03:00
Dmitry Stogov
1018f462d8 Patch improvement:
Removed the corresponding core code.
Fixed ext/com_dotnet and ext/date.
Refactored ext/intl changes.
Improved ext/fileinfo and ext/pdo changes.
Fixed tests.
2015-03-30 18:53:38 +03:00
Dmitry Stogov
9155a267ad Merge branch 'InternalClassClean' of github.com:Danack/php-src into InternalClassClean
* 'InternalClassClean' of github.com:Danack/php-src:
  Fixed indentation. Fixed comment style. Fixed commented out code.
  Reverted change to function name and added note of why it is different from the class it is actually changing.
  Made UConverter throw an exception if the constructor fails.
  Fixed PDO constructor to not return null.
  Fixed fileinfo behaviour.
  Made Phar throw exception on bad constructor.
  Converted intl extension to use IntlException in constructors.
  Fixed SplFixedArray and tests.
  Fixed ReflectionExtension and ReflectionProperty.
  Fixed ReflectionFunction, ReflectionMethod and ReflectionParameter.
  Fixed PDORow behaviour and message.
2015-03-30 12:14:43 +03:00
Anatol Belski
19360f386e cleanup mod version macros, round 3 2015-03-23 20:54:55 +01:00
Danack
6b232643e5 Reverted change to function name and added note of why it is different from the class it is actually changing. 2015-03-15 18:03:08 +00:00
Danack
d3267d0092 Fixed PDO constructor to not return null. 2015-03-15 15:03:03 +00:00
Danack
043a02605f Fixed ReflectionFunction, ReflectionMethod and ReflectionParameter. 2015-03-01 13:06:58 +00:00
Danack
b00cd68d74 Fixed PDORow behaviour and message. 2015-03-01 02:37:57 +00:00
Dmitry Stogov
1eb4352143 Use new ZEND_HASH_FOREACH_... API. 2015-02-10 15:43:12 +03:00
Matteo Beccati
b32458f0c9 Removed unused REGISTER_PDO_CONST_LONG 2015-02-08 13:31:01 +01:00
Dmitry Stogov
9e70d7672d Move zend_object->guards into additional slot of zend_object->properties_table[]. As result size of objects without __get/__set/__unset/__isset magic methods is reduced. 2015-02-04 15:24:13 +03:00
Michael Wallner
bd06f8bb5f fix warnings 2015-01-30 20:08:17 +01:00
Stanislav Malyshev
598c935245 update the .re file for PDO 2015-01-27 13:48:24 -08:00
Stanislav Malyshev
0290571ccf bump the API no 2015-01-27 09:22:20 -08:00
Stanislav Malyshev
dfe6aea9ca size_t cleanup for PDO 2015-01-26 16:16:02 -08:00