Commit graph

69 commits

Author SHA1 Message Date
Christoph M. Becker
1860ef22eb Fix #80521: Parameters with underscores no longer recognized
We have to use the proper value for the bitmask.
2020-12-16 20:04:52 +01:00
Simonov Denis
17a789e27c Fix #64937: Firebird PDO preprocessing sql
This patch fixes some problems with preprocessing SQL queries.

* The new algorithm takes into account single-line and multi-line
  comments and ignores the ":" and "?" Parameter markers in them.

* The algorithm allows the EXECUTE BLOCK statement to be processed
  correctly. For this statement, it is necessary to search for
  parameter markers between EXECUTE BLOCK and AS, the rest should be
  left as is.

The SQL preprocessing code has been ported from Firebird to handle
EXECUTE STATEMENT.

Closes GH-4920.
2020-09-25 00:07:57 +02:00
Christoph M. Becker
b6e70e14bd Fix PDO_Firebird tests which assume ERRMODE_SILENT
These have apparently been missed when PR 5388[1] had been merged.

[1] <https://github.com/php/php-src/pull/5388>
2020-07-12 18:15:56 +02:00
Nikita Popov
f8d795820e Reindent phpt files 2020-02-03 22:52:20 +01:00
Simonov Denis
3fb42a382c Add support for Interbase 1 dialect 2019-10-28 16:40:51 +01:00
Simonov Denis
481f89551e Request #77863: PDO firebird support type Boolean in input parameters 2019-09-10 09:22:26 +02:00
Christoph M. Becker
e4757ecc80 Re-add common PDO tests to Firebird test suite
These have been inadvertently dropped when changing the test suite to
not require ext/interbase anymore, so we add them back.

We also change the required environment variable names to match the
usual PDO names.  Particularly, we replace `PDO_FIREBIRD_TEST_HOSTNAME`
and `_DATABASE` with the more flexible `PDO_FIREBIRD_TEST_DSN`.
2019-05-04 14:24:15 +02:00
Kalle Sommer Nielsen
1c893b89bd PDO_Firebird test update, round 2
- This renames the environment variables to: PDO_FIREBIRD_TEST_XXX to be in line with other PDO test suites
- Adds an skipif.inc file that skips the tests if no database is set
- The test suite can now be run without PDO_FIREBIRD_TEST_HOSTNAME

$ set PDO_FIREBIRD_TEST_HOSTNAME=localhost
$ set PDO_FIREBIRD_TEST_DATABASE=C:\dev\php.fdb
$ nmake test TESTS=ext/pdo_firebird/tests
2019-05-02 23:19:27 +03:00
Kalle Sommer Nielsen
c9599c1c72 Rewrite PDO_Firebird tests to not depend on ext/interbase
I have no idea how I managed to get this to work, but there is 4 new environment variables that
can be specified for the connection:

- PDO_FIREBIRD_USERNAME
- PDO_FIREBIRD_PASSWORD
- PDO_FIREBIRD_HOSTNAME
- PDO_FIREBIRD_DATABASE

(See testdb.inc for more info)

The only way I could get this to work on my local machine was with a DSN like:

- firebird:dbname=localhost:C:\php.fdb

Hence why the 'hostname' can be specified.

There is also a bit mess in regards to cleanup of this extension tests, but I really do not want to dwell down there, if someone dares to do so, then please be my guest.
2019-05-02 21:48:24 +03:00
Peter Kokot
92ac598aab Remove local variables
This patch removes the so called local variables defined per
file basis for certain editors to properly show tab width, and
similar settings. These are mainly used by Vim and Emacs editors
yet with recent changes the once working definitions don't work
anymore in Vim without custom plugins or additional configuration.
Neither are these settings synced across the PHP code base.

A simpler and better approach is EditorConfig and fixing code
using some code style fixing tools in the future instead.

This patch also removes the so called modelines for Vim. Modelines
allow Vim editor specifically to set some editor configuration such as
syntax highlighting, indentation style and tab width to be set in the
first line or the last 5 lines per file basis. Since the php test
files have syntax highlighting already set in most editors properly and
EditorConfig takes care of the indentation settings, this patch removes
these as well for the Vim 6.0 and newer versions.

With the removal of local variables for certain editors such as
Emacs and Vim, the footer is also probably not needed anymore when
creating extensions using ext_skel.php script.

Additionally, Vim modelines for setting php syntax and some editor
settings has been removed from some *.phpt files.  All these are
mostly not relevant for phpt files neither work properly in the
middle of the file.
2019-02-03 21:03:00 +01:00
Peter Kokot
d679f02295 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:33:09 +02:00
Gabriel Caruso
9c144e0d82
Trim trailing whitespace in tests 2018-10-14 12:07:20 -03: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
Gabriel Caruso
c93aba042f
Give a reason why the test was skipped
This will help us debug why a test was skipped in GCOV
(http://gcov.php.net/viewer.php?version=PHP_HEAD&func=skip), and maybe
put them to run again
2018-07-22 16:41:41 -03:00
Anatol Belski
ed23cea9de Merge branch 'PHP-7.2'
* PHP-7.2:
  Fix event log handling in startup phase
  Fix bug #76488 Memory leak when fetching a BLOB field
2018-07-06 16:08:57 +02:00
sim1984
3847a6fcb6 Fix bug #76488 Memory leak when fetching a BLOB field
Add a phpt test
2018-07-06 16:07:28 +02:00
Dorin Marcoci
78f23a6dd4 Boolean data type support, added in Firebird 3. Fixes #74462. 2018-07-03 19:04:11 +02:00
Gabriel Caruso
21e3b0c70c Remove trailing whitespace in inc files 2018-02-10 19:20:23 +01:00
Anatol Belski
847e1f97da Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Return integer field types as native integers instead of strings
2017-01-06 18:12:52 +01:00
Dorin Marcoci
826122fa8e Return integer field types as native integers instead of strings
Use another define for better compatibility

Test case for #72583 Feature. Small optimisations.

Adjust conditional directives according to coding standards

Add more compatibility for "end of line" on multiple environements

Updated execute.phpt test after switching to integer mapping
2017-01-06 17:43:46 +01:00
Anatol Belski
b15cc7913a Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fix PDO tests to match SQL standard syntax and pass Firebird tests.
2017-01-03 17:54:46 +01:00
Dorin Marcoci
e914abff1e Fix PDO tests to match SQL standard syntax and pass Firebird tests. 2017-01-03 17:48:52 +01:00
Anatol Belski
f077ada348 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Cursor is not opened on singleton selects.
  fix arg spec and datatype, follow up on 73594
2016-12-18 21:55:30 +01:00
Dorin Marcoci
cf46ac1179 Cursor is not opened on singleton selects.
Test case for unregistered bug on FB3 singleton selects

Set error mode to warning instead of exception.
2016-12-18 21:53:51 +01:00
Anatol Belski
394a3593cc Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  git clean section
2016-12-08 03:24:59 +01:00
Anatol Belski
ff6565462e git clean section 2016-12-08 03:24:18 +01:00
Anatol Belski
67b7c5055c Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed bug #72931 PDO_FIREBIRD with Firebird 3.0 not work on returning statement
2016-12-07 21:07:14 +01:00
Dorin Marcoci
13ffa88e1f Fixed bug #72931 PDO_FIREBIRD with Firebird 3.0 not work on returning statement 2016-12-07 21:06:11 +01:00
Anatol Belski
faae3122d2 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fix blob parameters binding. Fixes: #73087, #61183, #71494
2016-11-05 22:54:44 +01:00
Dorin Marcoci
3d73f718b2 Fix blob parameters binding. Fixes: #73087, #61183, #71494
Adjusted formatting according to requirements

Test case for bug #73087
2016-11-05 22:49:16 +01:00
Anatol Belski
4a142af316 fix test portability 2016-06-17 17:09:42 +02:00
Matteo Beccati
a3b5b42e77 Merge branch 'PHP-5.3' into PHP-5.4 2013-05-31 16:26:54 +02:00
Matteo Beccati
510498947e Slightly edited tests and fix for bug #62024 2013-05-31 16:19:58 +02:00
Matheus Degiovani
df6ca450ce Fixed bug #62024 (unable to run consecutive prepared querys with null values)
Credits to james@kenjim.com for the patch.
2013-05-31 14:30:57 +02:00
Matheus Degiovani
65d233f06c Fixed bug #64037 (wrong value returned when using a negative numeric field equal to the scale) 2013-05-31 14:30:51 +02:00
Stanislav Malyshev
4d6bae896d skip tests if ibase not present 2012-07-31 21:45:04 -07:00
Popa Adrian Marius
f36a3113b6 fix gcov Warning: ibase_drop_db(): lock time-out on wait transaction object http://gcov.php.net/viewer.php?version=PHP_5_4&func=tests&file=ext%2Fpdo_firebird%2Ftests%2Fbug_53280.phpt 2012-02-05 09:58:50 +00:00
Popa Adrian Marius
53f5653bea fix gcov Warning: ibase_drop_db(): lock time-out on wait transaction object http://gcov.php.net/viewer.php?version=PHP_5_4&func=tests&file=ext%2Fpdo_firebird%2Ftests%2Fbug_53280.phpt 2012-02-05 09:58:50 +00:00
Popa Adrian Marius
d9f334c633 fix tablename in testcase test->testz 2011-12-28 19:09:41 +00:00
Popa Adrian Marius
24227957bf fix tablename in testcase test->testz 2011-12-28 19:09:41 +00:00
Popa Adrian Marius
c4c248c6e7 Added test case for PDO_Firebird: bug 53280 segfaults if query column count is less than param count 2011-12-28 18:52:39 +00:00
Popa Adrian Marius
0b692661d4 Added test case for PDO_Firebird: bug 53280 segfaults if query column count is less than param count 2011-12-28 18:52:39 +00:00
Popa Adrian Marius
e2c5167b7b one more error to fix Table unknown TEST , it should be TESTZ 2011-12-28 10:04:25 +00:00
Popa Adrian Marius
caeba0e83f one more error to fix Table unknown TEST , it should be TESTZ 2011-12-28 10:04:25 +00:00
Popa Adrian Marius
a2c7c201ab fix table name in testcase 2011-12-28 09:59:53 +00:00
Popa Adrian Marius
bba41172e7 fix table name in testcase 2011-12-28 09:59:53 +00:00
Popa Adrian Marius
c436981a70 added testcase for Bug 47415 2011-12-28 09:53:15 +00:00
Popa Adrian Marius
503540a4e4 added testcase for Bug 47415 2011-12-28 09:53:15 +00:00
Popa Adrian Marius
cc57d73844 cleanup for bug 48877 test, add description 2011-12-28 09:41:02 +00:00
Popa Adrian Marius
28878d390f cleanup for bug 48877 test, add description 2011-12-28 09:41:02 +00:00