Skip to content

Commit 21e61ad

Browse files
fix(ext/pgsql/tests): Unify SQL Keywords to uppercase letters
1 parent 6918e6f commit 21e61ad

36 files changed

+115
-115
lines changed

ext/pgsql/tests/01createdb.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ $table_name = 'table_01createdb';
4545
$table_name_92 = 'table_01createdb_92';
4646

4747
$db = pg_connect($conn_str);
48-
pg_query($db, "drop table {$table_name} cascade");
49-
pg_query($db, "drop table if exists {$table_name_92} cascade");
48+
pg_query($db, "DROP TABLE {$table_name} cascade");
49+
pg_query($db, "DROP TABLE if exists {$table_name_92} cascade");
5050
?>
5151
--EXPECT--
5252
OK

ext/pgsql/tests/03sync_query.phpt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ include('inc/config.inc');
1111
$table_name = "table_03sync_query";
1212

1313
$db = pg_connect($conn_str);
14-
pg_query($db, "create table {$table_name} (num int, str text, bin bytea)");
15-
pg_query($db, "insert into {$table_name} default values");
14+
pg_query($db, "CREATE TABLE {$table_name} (num int, str text, bin bytea)");
15+
pg_query($db, "INSERT INTO {$table_name} DEFAULT VALUES");
1616

1717
$result = pg_query($db, "SELECT * FROM ".$table_name.";");
1818
if (!($rows = pg_num_rows($result)))
@@ -143,7 +143,7 @@ include('inc/config.inc');
143143
$table_name = "table_03sync_query";
144144

145145
$db = pg_connect($conn_str);
146-
pg_query($db, "drop table {$table_name}");
146+
pg_query($db, "DROP TABLE {$table_name}");
147147
?>
148148
--EXPECT--
149149
Argument #3 must be greater than or equal to 0

ext/pgsql/tests/04async_query.phpt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ include('inc/config.inc');
1111
$table_name = "table_04async_query";
1212

1313
$db = pg_connect($conn_str);
14-
pg_query($db, "create table {$table_name} (num int, str text, bin bytea)");
15-
pg_query($db, "insert into {$table_name} default values");
14+
pg_query($db, "CREATE TABLE {$table_name} (num int, str text, bin bytea)");
15+
pg_query($db, "INSERT INTO {$table_name} DEFAULT VALUES");
1616

1717
if (!pg_send_query($db, "SELECT * FROM ".$table_name.";")) {
1818
echo "pg_send_query() error\n";
@@ -72,7 +72,7 @@ include('inc/config.inc');
7272
$table_name = "table_04async_query";
7373

7474
$db = pg_connect($conn_str);
75-
pg_query($db, "drop table {$table_name}");
75+
pg_query($db, "DROP TABLE {$table_name}");
7676
?>
7777
--EXPECT--
7878
OK

ext/pgsql/tests/05large_object.phpt

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,17 @@ include('inc/config.inc');
1212
$db = pg_connect($conn_str);
1313

1414
echo "create/write/close LO\n";
15-
pg_exec ($db, "begin");
15+
pg_exec ($db, "BEGIN");
1616
$oid = pg_lo_create ($db);
1717
if (!$oid) echo ("pg_lo_create() error\n");
1818
$handle = pg_lo_open ($db, $oid, "w");
1919
if (!$handle) echo ("pg_lo_open() error\n");
2020
pg_lo_write ($handle, "large object data");
2121
pg_lo_close ($handle);
22-
pg_exec ($db, "commit");
22+
pg_exec ($db, "COMMIT");
2323

2424
echo "open/read/tell/seek/close LO\n";
25-
pg_exec ($db, "begin");
25+
pg_exec ($db, "BEGIN");
2626
$handle = pg_lo_open ($db, $oid, "w");
2727
var_dump(pg_lo_read($handle, 5));
2828
var_dump(pg_lo_tell($handle));
@@ -34,50 +34,50 @@ var_dump(pg_lo_read($handle));
3434
var_dump(pg_lo_seek($handle, -4, PGSQL_SEEK_END)); /* Seek from the end */
3535
var_dump(pg_lo_read($handle));
3636
pg_lo_close($handle);
37-
pg_exec ($db, "commit");
37+
pg_exec ($db, "COMMIT");
3838

3939
echo "open/read_all/close LO\n";
40-
pg_exec ($db, "begin");
40+
pg_exec ($db, "BEGIN");
4141
$handle = pg_lo_open ($db, $oid, "w");
4242
/* Will write to stdout */
4343
$bytesWritten = pg_lo_read_all($handle);
4444
echo "\n";
4545
var_dump($bytesWritten);
4646
if (pg_last_error($db)) echo "pg_lo_read_all() error\n".pg_last_error();
4747
pg_lo_close($handle);
48-
pg_exec ($db, "commit");
48+
pg_exec ($db, "COMMIT");
4949

5050
echo "unlink LO\n";
51-
pg_exec ($db, "begin");
51+
pg_exec ($db, "BEGIN");
5252
pg_lo_unlink($db, $oid) or print("pg_lo_unlink() error 1\n");
53-
pg_exec ($db, "commit");
53+
pg_exec ($db, "COMMIT");
5454

5555
// more pg_lo_unlink() tests
5656
echo "Test without connection\n";
57-
pg_exec ($db, "begin");
57+
pg_exec ($db, "BEGIN");
5858
$oid = pg_lo_create ($db) or print("pg_lo_create() error\n");
5959
pg_lo_unlink($oid) or print("pg_lo_unlink() error 2\n");
60-
pg_exec ($db, "commit");
60+
pg_exec ($db, "COMMIT");
6161

6262
echo "Test with string oid value\n";
63-
pg_exec ($db, "begin");
63+
pg_exec ($db, "BEGIN");
6464
$oid = pg_lo_create ($db) or print("pg_lo_create() error\n");
6565
pg_lo_unlink($db, (string)$oid) or print("pg_lo_unlink() error 3\n");
66-
pg_exec ($db, "commit");
66+
pg_exec ($db, "COMMIT");
6767

6868
echo "import/export LO\n";
6969
$path = __DIR__ . '/';
70-
pg_query($db, 'begin');
70+
pg_query($db, 'BEGIN');
7171
$oid = pg_lo_import($db, $path . 'php.gif');
72-
pg_query($db, 'commit');
73-
pg_query($db, 'begin');
72+
pg_query($db, 'COMMIT');
73+
pg_query($db, 'BEGIN');
7474
@unlink($path . 'php.gif.exported');
7575
pg_lo_export($db, $oid, $path . 'php.gif.exported');
7676
if (!file_exists($path . 'php.gif.exported')) {
7777
echo "Export failed\n";
7878
}
7979
@unlink($path . 'php.gif.exported');
80-
pg_query($db, 'commit');
80+
pg_query($db, 'COMMIT');
8181

8282
/* invalid OID values */
8383
try {

ext/pgsql/tests/06_bug73498.phpt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ $table_name = "table_06_bug73498";
1212
$view_name = "view_06_bug73498";
1313

1414
$db = pg_connect($conn_str);
15-
pg_query($db, "create table {$table_name} (num int, str text, bin bytea)");
16-
pg_query($db, "create view {$view_name} as select * from {$table_name}");
17-
pg_query($db, "insert into {$table_name} default values");
15+
pg_query($db, "CREATE TABLE {$table_name} (num int, str text, bin bytea)");
16+
pg_query($db, "CREATE VIEW {$view_name} as SELECT * FROM {$table_name}");
17+
pg_query($db, "INSERT INTO {$table_name} DEFAULT VALUES");
1818

19-
$rows = pg_copy_to($db, "(select * from {$view_name})");
19+
$rows = pg_copy_to($db, "(SELECT * FROM {$view_name})");
2020

2121
var_dump(gettype($rows));
2222
var_dump(count($rows) > 0);
@@ -29,8 +29,8 @@ $table_name = "table_06_bug73498";
2929
$view_name = "view_06_bug73498";
3030

3131
$db = pg_connect($conn_str);
32-
pg_query($db, "drop view {$view_name}");
33-
pg_query($db, "drop table {$table_name}");
32+
pg_query($db, "DROP VIEW {$view_name}");
33+
pg_query($db, "DROP TABLE {$table_name}");
3434
?>
3535
--EXPECT--
3636
string(5) "array"

ext/pgsql/tests/06copy.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ include('inc/config.inc');
1111
$table_name = "table_06copy";
1212

1313
$db = pg_connect($conn_str);
14-
pg_query($db, "create table {$table_name} (num int, str text, bin bytea)");
14+
pg_query($db, "CREATE TABLE {$table_name} (num int, str text, bin bytea)");
1515

1616
$rows = pg_copy_to($db, $table_name);
1717

@@ -28,7 +28,7 @@ include('inc/config.inc');
2828
$table_name = "table_06copy";
2929

3030
$db = pg_connect($conn_str);
31-
pg_query($db, "drop table {$table_name}");
31+
pg_query($db, "DROP TABLE {$table_name}");
3232
?>
3333
--EXPECT--
3434
OK

ext/pgsql/tests/08escape.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ else {
4444
// Test using database
4545
$data = file_get_contents(FILE_NAME);
4646
$db = pg_connect($conn_str);
47-
pg_query($db, "create table {$table_name} (num int, str text, bin bytea)");
47+
pg_query($db, "CREATE TABLE {$table_name} (num int, str text, bin bytea)");
4848

4949
// Insert binary to DB
5050
$escaped_data = pg_escape_bytea($db, $data);
@@ -107,7 +107,7 @@ include('inc/config.inc');
107107
$table_name = "table_08escape";
108108

109109
$db = pg_connect($conn_str);
110-
pg_query($db, "drop table {$table_name}");
110+
pg_query($db, "DROP TABLE {$table_name}");
111111
?>
112112
--EXPECTF--
113113
Deprecated: pg_escape_string(): Automatic fetching of PostgreSQL connection is deprecated in %s on line %d

ext/pgsql/tests/10pg_convert_9.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ include 'inc/config.inc';
1515
$table_name = "table_10pg_convert_9";
1616

1717
$db = pg_connect($conn_str);
18-
pg_query($db, "create table {$table_name} (num int, str text, bin bytea)");
18+
pg_query($db, "CREATE TABLE {$table_name} (num int, str text, bin bytea)");
1919

2020
pg_query($db, "SET standard_conforming_strings = 0");
2121

@@ -58,7 +58,7 @@ include('inc/config.inc');
5858
$table_name = "table_10pg_convert_9";
5959

6060
$db = pg_connect($conn_str);
61-
pg_query($db, "drop table {$table_name}");
61+
pg_query($db, "DROP TABLE {$table_name}");
6262
?>
6363
--EXPECT--
6464
array(3) {

ext/pgsql/tests/10pg_convert_json_array.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ include 'inc/config.inc';
1515
$table_name_92 = "table_10pg_convert_json_array_92";
1616

1717
$db = pg_connect($conn_str);
18-
pg_query($db, "create table {$table_name_92} (textary text[], jsn json)");
18+
pg_query($db, "CREATE TABLE {$table_name_92} (textary text[], jsn json)");
1919

2020
$fields = array(
2121
'textary'=>'{"meeting", "lunch", "training", "presentation"}',
@@ -37,7 +37,7 @@ include('inc/config.inc');
3737
$table_name_92 = "table_10pg_convert_json_array_92";
3838

3939
$db = pg_connect($conn_str);
40-
pg_query($db, "drop table {$table_name_92}");
40+
pg_query($db, "DROP TABLE {$table_name_92}");
4141
?>
4242
--EXPECT--
4343
array(2) {

ext/pgsql/tests/11pg_meta_data.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ include 'inc/config.inc';
1212
$table_name = "table_11pg_meta_data";
1313

1414
$db = pg_connect($conn_str);
15-
pg_query($db, "create table {$table_name} (num int, str text, bin bytea)");
15+
pg_query($db, "CREATE TABLE {$table_name} (num int, str text, bin bytea)");
1616

1717
$meta = pg_meta_data($db, $table_name);
1818

@@ -24,7 +24,7 @@ include('inc/config.inc');
2424
$table_name = "table_11pg_meta_data";
2525

2626
$db = pg_connect($conn_str);
27-
pg_query($db, "drop table {$table_name}");
27+
pg_query($db, "DROP TABLE {$table_name}");
2828
?>
2929
--EXPECT--
3030
array(3) {

ext/pgsql/tests/12pg_insert_9.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ include 'inc/config.inc';
1515
$table_name = "table_12pg_insert_9";
1616

1717
$db = pg_connect($conn_str);
18-
pg_query($db, "create table {$table_name} (num int, str text, bin bytea)");
18+
pg_query($db, "CREATE TABLE {$table_name} (num int, str text, bin bytea)");
1919

2020
pg_query($db, "SET standard_conforming_strings = 0");
2121

@@ -62,7 +62,7 @@ include('inc/config.inc');
6262
$table_name = "table_12pg_insert_9";
6363

6464
$db = pg_connect($conn_str);
65-
pg_query($db, "drop table {$table_name}");
65+
pg_query($db, "DROP TABLE {$table_name}");
6666
?>
6767
--EXPECTF--
6868
INSERT INTO "table_12pg_insert_9" ("num","str","bin") VALUES (1234,E'AAA',E'\\x424242');

ext/pgsql/tests/13pg_select_9.phpt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ include 'inc/config.inc';
1515
$table_name = "table_13pg_select_9";
1616

1717
$db = pg_connect($conn_str);
18-
pg_query($db, "create table {$table_name} (num int, str text, bin bytea)");
19-
pg_query($db, "insert into {$table_name} values(1234, 'AAA', 'BBB')");
20-
pg_query($db, "insert into {$table_name} values(1234, 'AAA', 'BBB')");
18+
pg_query($db, "CREATE TABLE {$table_name} (num int, str text, bin bytea)");
19+
pg_query($db, "INSERT INTO {$table_name} VALUES(1234, 'AAA', 'BBB')");
20+
pg_query($db, "INSERT INTO {$table_name} VALUES(1234, 'AAA', 'BBB')");
2121

2222
pg_query($db, "SET bytea_output = 'hex'");
2323

@@ -65,7 +65,7 @@ include('inc/config.inc');
6565
$table_name = "table_13pg_select_9";
6666

6767
$db = pg_connect($conn_str);
68-
pg_query($db, "drop table {$table_name}");
68+
pg_query($db, "DROP TABLE {$table_name}");
6969
?>
7070
--EXPECT--
7171
array(2) {

ext/pgsql/tests/14pg_update_9.phpt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ include 'inc/config.inc';
1515
$table_name = "table_14pg_update_9";
1616

1717
$db = pg_connect($conn_str);
18-
pg_query($db, "create table {$table_name} (num int, str text, bin bytea)");
19-
pg_query($db, "insert into {$table_name} values(1, 'ABC', null)");
20-
pg_query($db, "insert into {$table_name} values(1, 'ABC', null)");
18+
pg_query($db, "CREATE TABLE {$table_name} (num int, str text, bin bytea)");
19+
pg_query($db, "INSERT INTO {$table_name} VALUES(1, 'ABC', null)");
20+
pg_query($db, "INSERT INTO {$table_name} VALUES(1, 'ABC', null)");
2121

2222
pg_query($db, "SET standard_conforming_strings = 0");
2323

@@ -36,7 +36,7 @@ include('inc/config.inc');
3636
$table_name = "table_14pg_update_9";
3737

3838
$db = pg_connect($conn_str);
39-
pg_query($db, "drop table {$table_name}");
39+
pg_query($db, "DROP TABLE {$table_name}");
4040
?>
4141
--EXPECT--
4242
UPDATE "table_14pg_update_9" SET "num"=1234,"str"=E'ABC',"bin"=E'\\x58595a' WHERE "num"=1234;

ext/pgsql/tests/15pg_delete.phpt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ include 'inc/config.inc';
1212
$table_name = "table_15pg_delete";
1313

1414
$db = pg_connect($conn_str);
15-
pg_query($db, "create table {$table_name} (num int, str text, bin bytea)");
16-
pg_query($db, "insert into {$table_name} values(1, 'ABC', null)");
17-
pg_query($db, "insert into {$table_name} values(1, 'ABC', null)");
15+
pg_query($db, "CREATE TABLE {$table_name} (num int, str text, bin bytea)");
16+
pg_query($db, "INSERT INTO {$table_name} VALUES(1, 'ABC', null)");
17+
pg_query($db, "INSERT INTO {$table_name} VALUES(1, 'ABC', null)");
1818

1919
$fields = array('num'=>'1234', 'str'=>'XXX', 'bin'=>'YYY');
2020
$ids = array('num'=>'1234');
@@ -33,7 +33,7 @@ include('inc/config.inc');
3333
$table_name = "table_15pg_delete";
3434

3535
$db = pg_connect($conn_str);
36-
pg_query($db, "drop table {$table_name}");
36+
pg_query($db, "DROP TABLE {$table_name}");
3737
?>
3838
--EXPECT--
3939
DELETE FROM "table_15pg_delete" WHERE "num"=1234;

ext/pgsql/tests/16pg_result_status.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ include 'inc/config.inc';
1010
$table_name = "table_16pg_result_status";
1111

1212
$db = pg_connect($conn_str);
13-
pg_query($db, "create table {$table_name} (num int, str text, bin bytea)");
13+
pg_query($db, "CREATE TABLE {$table_name} (num int, str text, bin bytea)");
1414

1515
$sql = "SELECT * FROM ".$table_name." WHERE num = -2";
1616
$result = pg_query($db, "BEGIN;END");
@@ -24,7 +24,7 @@ include('inc/config.inc');
2424
$table_name = "table_16pg_result_status";
2525

2626
$db = pg_connect($conn_str);
27-
pg_query($db, "drop table {$table_name}");
27+
pg_query($db, "DROP TABLE {$table_name}");
2828
?>
2929
--EXPECT--
3030
1

ext/pgsql/tests/17result.phpt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ include 'inc/config.inc';
1212
$table_name = "table_17result";
1313

1414
$db = pg_connect($conn_str);
15-
pg_query($db, "create table {$table_name} (num int, str text, bin bytea)");
16-
pg_query($db, "insert into {$table_name} values(1, 'ABC', null)");
17-
pg_query($db, "insert into {$table_name} values(1, 'ABC', null)");
15+
pg_query($db, "CREATE TABLE {$table_name} (num int, str text, bin bytea)");
16+
pg_query($db, "INSERT INTO {$table_name} VALUES(1, 'ABC', null)");
17+
pg_query($db, "INSERT INTO {$table_name} VALUES(1, 'ABC', null)");
1818

1919
$sql = "SELECT * FROM $table_name ORDER BY num";
2020
$result = pg_query($db, $sql) or die('Cannot query db');
@@ -35,7 +35,7 @@ include('inc/config.inc');
3535
$table_name = "table_17result";
3636

3737
$db = pg_connect($conn_str);
38-
pg_query($db, "drop table {$table_name}");
38+
pg_query($db, "DROP TABLE {$table_name}");
3939
?>
4040
--EXPECTF--
4141
bool(true)

ext/pgsql/tests/18pg_escape_bytea_before.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ $image = file_get_contents(__DIR__ . '/php.gif');
1515
$esc_image = pg_escape_bytea($image);
1616

1717
$db = pg_connect($conn_str);
18-
pg_query($db, "create table {$table_name} (num int, str text, bin bytea)");
18+
pg_query($db, "CREATE TABLE {$table_name} (num int, str text, bin bytea)");
1919

2020
@pg_query($db, "SET bytea_output = 'escape'");
2121

@@ -37,7 +37,7 @@ include('inc/config.inc');
3737
$table_name = "table_18pg_escape_bytea_before";
3838

3939
$db = pg_connect($conn_str);
40-
pg_query($db, "drop table {$table_name}");
40+
pg_query($db, "DROP TABLE {$table_name}");
4141
?>
4242
--EXPECTF--
4343
Deprecated: pg_escape_bytea(): Automatic fetching of PostgreSQL connection is deprecated in %s on line %d

0 commit comments

Comments
 (0)