Skip to content

Commit 1e012ec

Browse files
committed
Fix bug #81405: Restore old PDO::PARAM_* values
Doctrine hardcodes the values of these constants, avoid changing them. Closes GH-7445.
1 parent 16112a5 commit 1e012ec

File tree

7 files changed

+27
-26
lines changed

7 files changed

+27
-26
lines changed

ext/pdo/php_pdo_driver.h

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,16 @@ struct pdo_bound_param_data;
3535

3636
#define PDO_DRIVER_API 20170320
3737

38+
/* Doctrine hardcodes these constants, avoid changing their values. */
3839
enum pdo_param_type {
39-
PDO_PARAM_NULL,
40-
PDO_PARAM_BOOL,
41-
PDO_PARAM_INT,
42-
PDO_PARAM_STR,
43-
PDO_PARAM_LOB,
40+
PDO_PARAM_NULL = 0,
41+
PDO_PARAM_BOOL = 5,
42+
PDO_PARAM_INT = 1,
43+
PDO_PARAM_STR = 2,
44+
PDO_PARAM_LOB = 3,
4445

4546
/* get_col: Not supported (yet?) */
46-
PDO_PARAM_STMT, /* hierarchical result set */
47+
PDO_PARAM_STMT = 4, /* hierarchical result set */
4748

4849
/* magic flag to denote a parameter as being input/output */
4950
PDO_PARAM_INPUT_OUTPUT = 0x80000000,

ext/pdo/tests/debug_emulated_prepares.phpt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,17 +48,17 @@ Key: Name: [5] :bool
4848
paramno=-1
4949
name=[5] ":bool"
5050
is_param=1
51-
param_type=1
51+
param_type=5
5252
Key: Name: [4] :int
5353
paramno=-1
5454
name=[4] ":int"
5555
is_param=1
56-
param_type=2
56+
param_type=1
5757
Key: Name: [7] :string
5858
paramno=-1
5959
name=[7] ":string"
6060
is_param=1
61-
param_type=3
61+
param_type=2
6262
Key: Name: [5] :null
6363
paramno=-1
6464
name=[5] ":null"

ext/pdo_dblib/tests/bug_45876.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ array(10) {
3232
["native_usertype_id"]=>
3333
int(%d)
3434
["pdo_type"]=>
35-
int(3)
35+
int(2)
3636
["name"]=>
3737
string(13) "TABLE_CATALOG"
3838
["len"]=>

ext/pdo_dblib/tests/pdo_dblib_param_str_natl.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@ Key: Name: [6] :value
2424
paramno=-1
2525
name=[6] ":value"
2626
is_param=1
27-
param_type=1073741827
27+
param_type=1073741826
2828
NULL

ext/pdo_pgsql/tests/bug62498.phpt

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ array(9) {
5959
["native_type"]=>
6060
string(4) "int2"
6161
["pdo_type"]=>
62-
int(2)
62+
int(1)
6363
["name"]=>
6464
string(7) "int2col"
6565
["len"]=>
@@ -78,7 +78,7 @@ array(9) {
7878
["native_type"]=>
7979
string(4) "int4"
8080
["pdo_type"]=>
81-
int(2)
81+
int(1)
8282
["name"]=>
8383
string(7) "int4col"
8484
["len"]=>
@@ -97,7 +97,7 @@ array(9) {
9797
["native_type"]=>
9898
string(4) "int8"
9999
["pdo_type"]=>
100-
int(2)
100+
int(1)
101101
["name"]=>
102102
string(7) "int8col"
103103
["len"]=>
@@ -116,7 +116,7 @@ array(9) {
116116
["native_type"]=>
117117
string(7) "varchar"
118118
["pdo_type"]=>
119-
int(3)
119+
int(2)
120120
["name"]=>
121121
string(9) "stringcol"
122122
["len"]=>
@@ -135,7 +135,7 @@ array(9) {
135135
["native_type"]=>
136136
string(4) "bool"
137137
["pdo_type"]=>
138-
int(1)
138+
int(5)
139139
["name"]=>
140140
string(7) "boolcol"
141141
["len"]=>
@@ -154,7 +154,7 @@ array(9) {
154154
["native_type"]=>
155155
string(4) "date"
156156
["pdo_type"]=>
157-
int(3)
157+
int(2)
158158
["name"]=>
159159
string(7) "datecol"
160160
["len"]=>
@@ -173,7 +173,7 @@ array(9) {
173173
["native_type"]=>
174174
string(4) "text"
175175
["pdo_type"]=>
176-
int(3)
176+
int(2)
177177
["name"]=>
178178
string(7) "textcol"
179179
["len"]=>
@@ -192,7 +192,7 @@ array(9) {
192192
["native_type"]=>
193193
string(9) "timestamp"
194194
["pdo_type"]=>
195-
int(3)
195+
int(2)
196196
["name"]=>
197197
string(5) "tscol"
198198
["len"]=>
@@ -211,7 +211,7 @@ array(9) {
211211
["native_type"]=>
212212
string(5) "bytea"
213213
["pdo_type"]=>
214-
int(4)
214+
int(3)
215215
["name"]=>
216216
string(8) "byteacol"
217217
["len"]=>

ext/pdo_pgsql/tests/debug_emulated_prepares.phpt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,17 @@ Key: Name: [5] :bool
3333
paramno=-1
3434
name=[5] ":bool"
3535
is_param=1
36-
param_type=3
36+
param_type=2
3737
Key: Name: [4] :int
3838
paramno=-1
3939
name=[4] ":int"
4040
is_param=1
41-
param_type=2
41+
param_type=1
4242
Key: Name: [7] :string
4343
paramno=-1
4444
name=[7] ":string"
4545
is_param=1
46-
param_type=3
46+
param_type=2
4747
Key: Name: [5] :null
4848
paramno=-1
4949
name=[5] ":null"

ext/pdo_sqlite/tests/debugdumpparams_001.phpt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@ Key: Name: [2] :a
2121
paramno=-1
2222
name=[2] ":a"
2323
is_param=1
24-
param_type=2
24+
param_type=1
2525
Key: Name: [2] :b
2626
paramno=-1
2727
name=[2] ":b"
2828
is_param=1
29-
param_type=3
29+
param_type=2
3030
Key: Position #2:
3131
paramno=2
3232
name=[0] ""
3333
is_param=1
34-
param_type=3
34+
param_type=2
3535
NULL

0 commit comments

Comments
 (0)