Commit graph

93 commits

Author SHA1 Message Date
Javier Eguiluz
732d92c0e5
[skip ci] Fix various typos and grammar issues (#11143) 2023-04-28 11:05:32 +02:00
Ilija Tovilo
9d5f2f1343
Use new ZSTR_INIT_LITERAL macro (#10879) 2023-03-20 16:19:05 +01:00
Tim Starling
8eee0d6130
Make strtolower() and strtoupper() do ASCII case conversion (#7506)
Implement RFC https://wiki.php.net/rfc/strtolower-ascii
2021-12-15 08:38:35 -05:00
Tim Starling
da0c70508e
Add upper case functions to zend_operators.c and use them (#7521)
Add a family of upper case conversion functions to zend_operators.c,
by analogy with the lower case functions.

Move the single-character conversion macros to the header so that they
can be used as a locale-independent replacement for tolower() and
toupper().

Factor out the ugly bits of the SSE2 case conversion so that the four
functions that use it are easy to read and processor-independent.

Use the new ASCII upper case functions in ext/xml, ext/pdo_dblib and as
an optimization for strtoupper() when the locale is "C".
2021-09-29 09:37:40 +02:00
KsaR
01b3fc03c3
Update http->https in license (#6945)
1. Update: http://www.php.net/license/3_01.txt to https, as there is anyway server header "Location:" to https.
2. Update few license 3.0 to 3.01 as 3.0 states "php 5.1.1, 4.1.1, and earlier".
3. In some license comments is "at through the world-wide-web" while most is without "at", so deleted.
4. fixed indentation in some files before |
2021-05-06 12:16:35 +02:00
Nikita Popov
caa710037e Rewrite PDO result binding
Instead of requiring the type to be determined in advance by the
describer function and then requiring get_col to return a buffer
of appropriate type, allow get_col to return an arbitrary zval.
See UPGRADING.INTERNALS for a more detailed description of the
change.

This makes the result fetching simpler, more efficient and more
flexible. The general possibility already existed via the special
PDO_PARAM_ZVAL type, but the usage was very inconvenient and/or
inefficient. Now it's possible to easily implement behavior like
"return int if it fits, otherwise string" and to avoid any kind
of complex management of temporary buffers.

This also fixes bug #40913 (our second highest voted bug of all
time, for some reason). PARAM_LOB result bindings will now
consistently return a stream resource, independently of the used
database driver.

I've tried my best to update all PDO drivers for this change, but
some of the changes may be broken, as I cannot test or even build
some of these drivers (in particular PDO dblib and PDO oci).
Fixes are appreciated -- a working CI setup would be even more
appreciated ;)
2020-12-22 15:56:34 +01:00
Nikita Popov
2d51c203f0 PDO: Store/pass query_string as zend_string
Rather than storing char* + size_t, use a zend_string*. Also
avoid various copies of the query string.
2020-12-14 10:43:28 +01:00
George Peter Banyard
1c598cf6a8 Fix [-Wundef] warning in PDO DBLib extension 2020-05-20 16:29:52 +02:00
Gabriel Caruso
5d6e923d46
Remove mention of PHP major version in Copyright headers
Closes GH-4732.
2019-09-25 14:51:43 +02:00
Zeev Suraski
38c337f22e Remove year range from copyright notice 2019-01-30 11:00:23 +02:00
Peter Kokot
8d3f8ca12a Remove unused Git attributes ident
The $Id$ keywords were used in Subversion where they can be substituted
with filename, last revision number change, last changed date, and last
user who changed it.

In Git this functionality is different and can be done with Git attribute
ident. These need to be defined manually for each file in the
.gitattributes file and are afterwards replaced with 40-character
hexadecimal blob object name which is based only on the particular file
contents.

This patch simplifies handling of $Id$ keywords by removing them since
they are not used anymore.
2018-07-25 00:53:25 +02:00
Xinchen Hui
a6519d0514 year++ 2018-01-02 12:57:58 +08:00
Dmitry Stogov
0d484172fe Turn "pdo_stmt_methods" into constants. 2017-12-14 22:59:58 +03:00
fandrieu
a0ed09f92b Treat DATETIME2 columns like DATETIME 2017-11-10 17:20:33 -05:00
Adam Baratz
01f2427b83 More robust handling of stringified column data
- Use at least the FreeTDS maximum when converting datetime data
 - Pass buffer length to dbconvert()
 - Use dbconvert() return value to set string lengths or handle errors
 - Move shared code into shared function
2017-11-10 13:29:14 -05:00
fandrieu
b72af30a53 Fix #74243: allow locales.conf to drive datetime format
Add a driver attribute, PDO::DBLIB_ATTR_DATETIME_CONVERT, to control.
2017-10-31 17:52:59 -04:00
Adam Baratz
2ecfcdaf1b Use size_t instead of int, use more specific format string 2017-10-31 16:43:35 -04:00
fandrieu
014fd21b48 Implemented request #69592: allow 0-column rowsets to be skipped automatically
This adds a new attribute PDO::DBLIB_ATTR_SKIP_EMPTY_ROWSETS to enable automatic
skipping of empty rowsets.

This happens with some SQL commands (like PRINT or SET): a rowset with 0 columns
is returned by the driver.

With this option enabled, 0 columns rowsets are automatically skipped, mirroring
the behavior of the deprecated mssql extension.

Credits go to MiRacLe-RPZ for developping and promoting this patch.
2017-10-17 14:16:38 -04:00
Sammy Kaye Powers
9e29f841ce Update copyright headers to 2017 2017-01-02 09:30:12 -06:00
Adam Baratz
d98da850c4 Merge branch 'PHP-7.1'
* PHP-7.1:
  Remove noop param hook
  Clean up tabs and whitespace
2016-12-07 17:10:36 -05:00
Adam Baratz
5a20d83be8 Remove noop param hook 2016-12-07 17:09:09 -05:00
Adam Baratz
8176fdcb33 Use more accurate types to avoid compiler warnings 2016-10-31 13:15:46 -04:00
Adam Baratz
69b776ec10 Fix comment style 2016-10-31 12:39:22 -04:00
Adam Baratz
0a2c02cb57 Fix #73396: bigint columns are returned as strings 2016-10-27 13:52:59 -04:00
Adam Baratz
886e721356 Remove unneeded macro check. This "hack" is replicated in php_pdo_dblib_int.h. 2016-10-27 12:15:45 -04:00
Adam Baratz
3d35f0b3b2 remove unread var 2016-10-27 12:15:01 -04:00
Peter LeBrun
dfd6baee0c PHP bug 67130: nextRowset should work with unfetched rows 2016-09-21 14:27:23 -04:00
Adam Baratz
69eef8c361 Free error and message strings when cleaning up PDO instances that use pdo_dblib 2016-09-13 16:43:30 -04:00
Adam Baratz
91c49c4ab0 Handle SQLDECIMAL/SQLNUMERIC types, which are used by later TDS versions 2016-09-13 16:32:37 -04:00
Alexander Zhuravlev
a000bff2c3 pdo_dblib: stringify uniqidentifier field
Keep old 5.6 behavior: return Uniqidentifier value as 36-byte hex string (not binary),
when PDO::ATTR_STRINGIFY_FETCHES is TRUE

pdo_dblib: Stringify uniqidentifier field

Keep old 5.6 behavior: return Uniqidentifier value as 36-byte hex string (not binary),
when PDO::ATTR_STRINGIFY_FETCHES is TRUE

Tests added.

pdo_dblib: Stringify uniqidentifier field

Keep old 5.6 behavior: return Uniqidentifier value as 36-byte hex string (not binary),
when PDO::ATTR_STRINGIFY_FETCHES is TRUE

Tests fix.

pdo_dblib: Stringify uniqueidentifier field Added separate PDO::DBLIB_ATTR_STRINGIFY_UNIQUEIDENTIFIER attribute instead of PDO::ATTR_STRINGIFY_FETCHES.

pdo_dblib: Stringify uniqueidentifier field Added `getAttribute` support for PDO::DBLIB_ATTR_STRINGIFY_UNIQUEIDENTIFIER.

Simplify storage of stringify_uniqueidentifier attribute
2016-08-25 19:37:21 +02:00
Adam Baratz
ed3edc2f05 fix bug #71667 (emulate how mssql extension names "computed" columns) 2016-04-06 14:41:55 +02:00
Adam Baratz
1e1500a2bc return zvals instead of strings, cast or not based on stringify attribute 2016-04-06 12:18:53 +02:00
Adam Baratz
8a92fed532 Add driver-specific attributes for controlling calls to dbsetlogintime() and dbsettime() 2016-04-05 18:18:37 +02:00
Remi Collet
46293ed6d4 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  fix #ifdef usage
2016-03-16 07:18:09 +01:00
Remi Collet
478c807128 fix #ifdef usage 2016-03-16 07:17:49 +01:00
Anatol Belski
56ab4a6096 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fixed #54648 PDO::MSSQL forces format of datetime fields
2016-02-29 17:07:05 +01:00
Anatol Belski
53c036b30b Fixed #54648 PDO::MSSQL forces format of datetime fields
adopted patch by steven dot lambeth at gmx dot de
2016-02-29 17:04:49 +01:00
Anatol Belski
44c3f1492f Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  remove unneeded free parts
2016-02-29 16:30:33 +01:00
Anatol Belski
7816698580 remove unneeded free parts
See bug #71667, free_statement already does the job
2016-02-29 16:26:46 +01:00
Anatol Belski
f806fedd80 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  fix leaks and add one more NULL check
  add NULL check
  fix C89 compat
  fix arg type
2016-02-29 15:48:51 +01:00
Anatol Belski
d7fd614cc6 fix leaks and add one more NULL check 2016-02-29 15:38:42 +01:00
Anatol Belski
a310c3b484 add NULL check 2016-02-29 15:26:57 +01:00
Anatol Belski
35be4398d1 fix arg type 2016-02-29 15:23:53 +01: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
Anatol Belski
af8937c056 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  C89 compat
  use spprintf instead (no need to estrdup afterwards).
  dblib's dbcolname can return null in some cases
  testcase fot bug #69757
  Segmentation fault on pdo_dblib::nextRowset (bug #69757)

Conflicts:
	ext/pdo_dblib/dblib_stmt.c
2015-10-18 11:28:57 +02:00
Anatol Belski
7f33ab834d C89 compat 2015-10-18 11:14:30 +02:00
MiRacLe.RPZ
2b5af600e3 use spprintf instead (no need to estrdup afterwards). 2015-10-18 11:10:50 +02:00
MiRacLe.RPZ
5c19355095 dblib's dbcolname can return null in some cases 2015-10-18 11:10:45 +02:00
MiRacLe.RPZ
acb2368976 Segmentation fault on pdo_dblib::nextRowset (bug #69757) 2015-10-18 11:10:34 +02:00