Commit Graph

225 Commits

Author SHA1 Message Date
Peter Kokot
b746e69887 Sync leading and final newlines in *.phpt sections
This patch adds missing newlines, trims multiple redundant final
newlines into a single one, and trims redundant leading newlines in all
*.phpt sections.

According to POSIX, a line is a sequence of zero or more non-' <newline>'
characters plus a terminating '<newline>' character. [1] Files should
normally have at least one final newline character.

C89 [2] and later standards [3] mention a final newline:
"A source file that is not empty shall end in a new-line character,
which shall not be immediately preceded by a backslash character."

Although it is not mandatory for all files to have a final newline
fixed, a more consistent and homogeneous approach brings less of commit
differences issues and a better development experience in certain text
editors and IDEs.

[1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206
[2] https://port70.net/~nsz/c/c89/c89-draft.html#2.1.1.2
[3] https://port70.net/~nsz/c/c99/n1256.html#5.1.1.2
2018-10-15 04:32:30 +02:00
Peter Kokot
782352c54a Trim trailing whitespace in *.phpt 2018-10-14 19:45:12 +02:00
Peter Kokot
1c850bfcca Sync leading and final newlines in source code files
This patch adds missing newlines, trims multiple redundant final
newlines into a single one, and trims redundant leading newlines.

According to POSIX, a line is a sequence of zero or more non-' <newline>'
characters plus a terminating '<newline>' character. [1] Files should
normally have at least one final newline character.

C89 [2] and later standards [3] mention a final newline:
"A source file that is not empty shall end in a new-line character,
which shall not be immediately preceded by a backslash character."

Although it is not mandatory for all files to have a final newline
fixed, a more consistent and homogeneous approach brings less of commit
differences issues and a better development experience in certain text
editors and IDEs.

[1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206
[2] https://port70.net/~nsz/c/c89/c89-draft.html#2.1.1.2
[3] https://port70.net/~nsz/c/c99/n1256.html#5.1.1.2
2018-10-14 12:55:24 +02:00
Peter Kokot
cf3b852109 Trim trailing whitespaces in build files
Some editors utilizing .editorconfig automatically trim whitespaces. For
convenience this patch removes whitespaces in certain build files:
- ext/*/config*.m4
- configure.ac
- acinclude.m4
2018-07-29 03:43:45 +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
Dmitry Stogov
9e709e2fa0 Move constants into read-only data segment 2017-12-14 18:43:44 +03:00
fandrieu
a0ed09f92b Treat DATETIME2 columns like DATETIME 2017-11-10 17:20:33 -05:00
Adam Baratz
1027ed3767 Use TDS version attribute to determine whether to skip tests 2017-11-10 14:36:35 -05:00
fandrieu
b760b46216 Expose TDS version as \PDO::DBLIB_ATTR_TDS_VERSION attribute on \PDO instance 2017-11-10 14:21:07 -05:00
Adam Baratz
50421b3da5 Fix comment style 2017-11-10 13:31:59 -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
Adam Baratz
9ebb38ca1d Output column data for easier debugging 2017-11-08 17:12:33 -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
Kalle Sommer Nielsen
c34ba92782 Get rid of all these old package[2].xml files, most of these had no had a release since PHP4, or any release at all in close to 10 years, some even did not have a package registered at pecl
OCI, PDO_OCI and zip are left as they are actively developed and released there
2017-08-17 22:09:29 +02:00
Anatol Belski
e0809fe62d remove checks for eol dependencies
yet one leftower, only FreeTDS is usable at the moment
2017-07-10 15:00:16 +02:00
Adam Baratz
4afce8ec8c Add PDO parameter types for national character set strings 2017-03-20 18:25:50 -04:00
Adam Baratz
3817cba786 Style cleanup 2017-03-20 17:56:19 -04:00
Adam Baratz
f45e6364b4 Add test coverage for bug #72969
This was not an issue with pdo_dblib, but rather with FreeTDS. FreeTDS has been
fixed as of the fc820490336c50d5c175d2a15327383256add4c9 on that repo. These
tests will be skipped if a version of FreeTDS with that issue is present.

I only cleaned up this commit for pushing. For fixing the FreeTDS issue and
writing corresponding pdo_dblib tests, thanks to:
Jeff Farr <jefarr@wayfair.com>
2017-01-27 18:47:00 -05:00
Adam Baratz
9e18f1d4af Expose DB-Library version as \PDO::DBLIB_ATTR_VERSION attribute on \PDO instance 2017-01-27 18:38:56 -05:00
Adam Baratz
147a3dd379 style cleanup 2017-01-27 18:24:45 -05:00
Sammy Kaye Powers
9e29f841ce Update copyright headers to 2017 2017-01-02 09:30:12 -06:00
Adam Baratz
d58231dda3 Add "Sent SQL" to debug dump for emulated prepares 2016-12-20 11:07:04 -05:00
Adam Baratz
6c692313af Remove PDOStatement::activeQueryString() 2016-12-20 11:06:38 -05: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
e133a2dd78 Clean up tabs and whitespace 2016-12-07 17:08:51 -05:00
Adam Baratz
07e395a00d Revert "Remove PDOStatement::activeQueryString()"
This reverts commit 552c957500.
2016-11-17 11:25:31 -05:00
Adam Baratz
552c957500 Remove PDOStatement::activeQueryString() 2016-11-16 18:06:14 -05:00
Adam Baratz
83086d9a72 Add PDOStatement::activeQueryString() 2016-11-15 17:33:38 -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
Adam Baratz
6b931b813f add myself to pdo_dblib CREDITS 2016-10-27 12:14:12 -04:00
Adam Baratz
3d321a4aa4 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  update NEWS
  Ignore potentially misleading dberr values
2016-09-26 17:13:14 -04:00
Chris Kings-Lynne
48b5a1f9b9 Ignore potentially misleading dberr values
FreeTDS had a buggy behavior where it would pass invalid values:
https://sourceforge.net/p/freetds/bugs/59/

The fix for this issue -- bc22b2ef817fb5d102bd758111ff3634b39a1319 on their
repo -- was to always use SYBESMSG for dberr. This makes it so the existing
pdo_dblib code would work as is. But by ignoring the dberr value in this
function, it will behave correctly, even with older versions of FreeTDS.
2016-09-26 17:07:46 -04:00
Adam Baratz
e14636f4bd Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Limit size of result set for test query
2016-09-21 16:23:58 -04:00
Adam Baratz
d334d319f0 Limit size of result set for test query
This result set can be very large, depending on the database. This change
ensures this test won't be slow.
2016-09-21 16:21:33 -04:00
Adam Baratz
5ab064caed Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  update NEWS
  PHP bug 67130: nextRowset should work with unfetched rows
2016-09-21 15:15:18 -04:00
Peter LeBrun
dfd6baee0c PHP bug 67130: nextRowset should work with unfetched rows 2016-09-21 14:27:23 -04:00
Adam Baratz
7726151aa8 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Move dtor before memory freed to avoid invalid read
2016-09-21 12:02:17 -04:00
Adam Baratz
b29ad29b91 Move dtor before memory freed to avoid invalid read 2016-09-21 12:00:19 -04:00
Adam Baratz
2f99f702b7 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Skip test for early TDS versions
2016-09-14 11:07:26 -04:00
Adam Baratz
f559fb7556 Skip test for early TDS versions 2016-09-14 11:06:54 -04:00
Adam Baratz
f6b6e97b29 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Add special case for earlier versions of TDS
  Adjust error formatting so ext/pdo/tests/bug_43130.phpt passes with pdo_dblib
  Free error and message strings when cleaning up PDO instances that use pdo_dblib
  Add common suite
2016-09-13 17:02:53 -04:00