Commit Graph

212 Commits

Author SHA1 Message Date
Peter Kokot
f1d7e3ca0b 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:31:31 +02:00
Peter Kokot
17ccbeec32 Trim trailing whitespace in *.phpt 2018-10-14 19:44:14 +02:00
Peter Kokot
60a69daec6 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:54:08 +02:00
Peter Kokot
902d39a3a7 Trim trailing whitespace in source code files 2018-10-13 14:14:50 +02:00
Xinchen Hui
7a7ec01a49 year++ 2018-01-02 12:55:14 +08: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
Adam Baratz
0de333bd62 Adjust error formatting so ext/pdo/tests/bug_43130.phpt passes with pdo_dblib 2016-09-13 16:43:33 -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
efadcb0390 Add common suite 2016-09-13 16:43:25 -04:00
Adam Baratz
c02ff02953 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Handle SQLDECIMAL/SQLNUMERIC types, which are used by later TDS versions
2016-09-13 16:33:18 -04:00
Adam Baratz
91c49c4ab0 Handle SQLDECIMAL/SQLNUMERIC types, which are used by later TDS versions 2016-09-13 16:32:37 -04:00
Adam Baratz
421f654874 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Allow \PDO::setAttribute() to set pdo_dblib query timeouts
2016-09-13 16:14:55 -04:00
Adam Baratz
9cdf2042bd Allow \PDO::setAttribute() to set pdo_dblib query timeouts 2016-09-13 16:13:26 -04:00
Adam Baratz
76af2def79 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Never quote values as raw binary data
2016-09-12 17:44:33 -04:00
Adam Baratz
2302eef5c9 Never quote values as raw binary data
This reverts a1a18fca6e which was intended to fix
bug #52885. That commit introduced a BC break which wasn't universally
desirable. The issue of quoting binary data (or NVARCHAR strings, or other
nonstandard types) will have to be addressed separately.
2016-09-12 17:32:50 -04:00
Stanislav Malyshev
f57c059b96 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Recognize TDS versions 7.3 and 7.4
2016-09-05 00:29:21 -07:00
Stanislav Malyshev
b5f9427ca9 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Recognize TDS versions 7.3 and 7.4
2016-09-05 00:29:18 -07:00
Stanislav Malyshev
cee363d609 Merge branch 'pull-request/2061' into PHP-5.6
* pull-request/2061:
  Recognize TDS versions 7.3 and 7.4
2016-09-05 00:29:11 -07:00
Stanislav Malyshev
498e36294e Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Use integer placeholders, since values can vary with the TDS version
2016-09-05 00:19:34 -07:00