diff --git a/hphp/test/zend/bad/ext-pgsql/01createdb.php b/hphp/test/zend/bad/ext-pgsql/01createdb.php new file mode 100644 index 000000000..d6b98a972 --- /dev/null +++ b/hphp/test/zend/bad/ext-pgsql/01createdb.php @@ -0,0 +1,21 @@ + \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-pgsql/01createdb.php.expectf b/hphp/test/zend/bad/ext-pgsql/01createdb.php.expectf new file mode 100644 index 000000000..a0aba9318 --- /dev/null +++ b/hphp/test/zend/bad/ext-pgsql/01createdb.php.expectf @@ -0,0 +1 @@ +OK \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-pgsql/02connection.php b/hphp/test/zend/bad/ext-pgsql/02connection.php new file mode 100644 index 000000000..26de49c12 --- /dev/null +++ b/hphp/test/zend/bad/ext-pgsql/02connection.php @@ -0,0 +1,51 @@ + +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-pgsql/02connection.php.expectf b/hphp/test/zend/bad/ext-pgsql/02connection.php.expectf new file mode 100644 index 000000000..9bdb9601a --- /dev/null +++ b/hphp/test/zend/bad/ext-pgsql/02connection.php.expectf @@ -0,0 +1,2 @@ +resource(%d) of type (pgsql link%s) +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-pgsql/03sync_query.php b/hphp/test/zend/bad/ext-pgsql/03sync_query.php new file mode 100644 index 000000000..adce503b6 --- /dev/null +++ b/hphp/test/zend/bad/ext-pgsql/03sync_query.php @@ -0,0 +1,66 @@ + \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-pgsql/03sync_query.php.expectf b/hphp/test/zend/bad/ext-pgsql/03sync_query.php.expectf new file mode 100644 index 000000000..a0aba9318 --- /dev/null +++ b/hphp/test/zend/bad/ext-pgsql/03sync_query.php.expectf @@ -0,0 +1 @@ +OK \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-pgsql/04async_query.php b/hphp/test/zend/bad/ext-pgsql/04async_query.php new file mode 100644 index 000000000..a89828c3d --- /dev/null +++ b/hphp/test/zend/bad/ext-pgsql/04async_query.php @@ -0,0 +1,58 @@ + \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-pgsql/04async_query.php.expectf b/hphp/test/zend/bad/ext-pgsql/04async_query.php.expectf new file mode 100644 index 000000000..a0aba9318 --- /dev/null +++ b/hphp/test/zend/bad/ext-pgsql/04async_query.php.expectf @@ -0,0 +1 @@ +OK \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-pgsql/05large_object.php b/hphp/test/zend/bad/ext-pgsql/05large_object.php new file mode 100644 index 000000000..60b0aadd0 --- /dev/null +++ b/hphp/test/zend/bad/ext-pgsql/05large_object.php @@ -0,0 +1,67 @@ + \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-pgsql/05large_object.php.expectf b/hphp/test/zend/bad/ext-pgsql/05large_object.php.expectf new file mode 100644 index 000000000..ade9fe7d0 --- /dev/null +++ b/hphp/test/zend/bad/ext-pgsql/05large_object.php.expectf @@ -0,0 +1,9 @@ +create/write/close LO +open/read/tell/seek/close LO +open/read_all/close LO +large object data +unlink LO +Test without connection +Test with string oid value +import/export LO +OK \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-pgsql/06copy.php b/hphp/test/zend/bad/ext-pgsql/06copy.php new file mode 100644 index 000000000..abe2a1371 --- /dev/null +++ b/hphp/test/zend/bad/ext-pgsql/06copy.php @@ -0,0 +1,15 @@ + \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-pgsql/06copy.php.expectf b/hphp/test/zend/bad/ext-pgsql/06copy.php.expectf new file mode 100644 index 000000000..a0aba9318 --- /dev/null +++ b/hphp/test/zend/bad/ext-pgsql/06copy.php.expectf @@ -0,0 +1 @@ +OK \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-pgsql/07optional.php b/hphp/test/zend/bad/ext-pgsql/07optional.php new file mode 100644 index 000000000..d6e595fdd --- /dev/null +++ b/hphp/test/zend/bad/ext-pgsql/07optional.php @@ -0,0 +1,17 @@ + \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-pgsql/07optional.php.expectf b/hphp/test/zend/bad/ext-pgsql/07optional.php.expectf new file mode 100644 index 000000000..a0aba9318 --- /dev/null +++ b/hphp/test/zend/bad/ext-pgsql/07optional.php.expectf @@ -0,0 +1 @@ +OK \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-pgsql/08escape.php b/hphp/test/zend/bad/ext-pgsql/08escape.php new file mode 100644 index 000000000..4bef8cb86 --- /dev/null +++ b/hphp/test/zend/bad/ext-pgsql/08escape.php @@ -0,0 +1,84 @@ + \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-pgsql/08escape.php.expectf b/hphp/test/zend/bad/ext-pgsql/08escape.php.expectf new file mode 100644 index 000000000..2a1e2cb94 --- /dev/null +++ b/hphp/test/zend/bad/ext-pgsql/08escape.php.expectf @@ -0,0 +1,5 @@ +pg_escape_string() is Ok +pg_escape_bytea() is Ok +pg_escape_bytea() actually works with database +pg_escape_literal() is Ok +pg_escape_identifier() is Ok \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-pgsql/10pg_convert.php b/hphp/test/zend/bad/ext-pgsql/10pg_convert.php new file mode 100644 index 000000000..85dedb760 --- /dev/null +++ b/hphp/test/zend/bad/ext-pgsql/10pg_convert.php @@ -0,0 +1,12 @@ +'1234', 'str'=>'AAA', 'bin'=>'BBB'); +$converted = pg_convert($db, $table_name, $fields); + +var_dump($converted); +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-pgsql/10pg_convert.php.expectf b/hphp/test/zend/bad/ext-pgsql/10pg_convert.php.expectf new file mode 100644 index 000000000..f98fdebcc --- /dev/null +++ b/hphp/test/zend/bad/ext-pgsql/10pg_convert.php.expectf @@ -0,0 +1,8 @@ +array(3) { + ["num"]=> + string(4) "1234" + ["str"]=> + string(5) "'AAA'" + ["bin"]=> + string(5) "'BBB'" +} \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-pgsql/10pg_convert_85.php b/hphp/test/zend/bad/ext-pgsql/10pg_convert_85.php new file mode 100644 index 000000000..85dedb760 --- /dev/null +++ b/hphp/test/zend/bad/ext-pgsql/10pg_convert_85.php @@ -0,0 +1,12 @@ +'1234', 'str'=>'AAA', 'bin'=>'BBB'); +$converted = pg_convert($db, $table_name, $fields); + +var_dump($converted); +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-pgsql/10pg_convert_85.php.expectf b/hphp/test/zend/bad/ext-pgsql/10pg_convert_85.php.expectf new file mode 100644 index 000000000..6c05ac47b --- /dev/null +++ b/hphp/test/zend/bad/ext-pgsql/10pg_convert_85.php.expectf @@ -0,0 +1,8 @@ +array(3) { + ["num"]=> + string(4) "1234" + ["str"]=> + string(5) "'AAA'" + ["bin"]=> + string(11) "'\\x424242'" +} \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-pgsql/11pg_meta_data.php b/hphp/test/zend/bad/ext-pgsql/11pg_meta_data.php new file mode 100644 index 000000000..c6f6e7f34 --- /dev/null +++ b/hphp/test/zend/bad/ext-pgsql/11pg_meta_data.php @@ -0,0 +1,11 @@ + \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-pgsql/11pg_meta_data.php.expectf b/hphp/test/zend/bad/ext-pgsql/11pg_meta_data.php.expectf new file mode 100644 index 000000000..c0701e9ce --- /dev/null +++ b/hphp/test/zend/bad/ext-pgsql/11pg_meta_data.php.expectf @@ -0,0 +1,47 @@ +array(3) { + ["num"]=> + array(6) { + ["num"]=> + int(1) + ["type"]=> + string(4) "int4" + ["len"]=> + int(4) + ["not null"]=> + bool(false) + ["has default"]=> + bool(false) + ["array dims"]=> + int(0) + } + ["str"]=> + array(6) { + ["num"]=> + int(2) + ["type"]=> + string(4) "text" + ["len"]=> + int(-1) + ["not null"]=> + bool(false) + ["has default"]=> + bool(false) + ["array dims"]=> + int(0) + } + ["bin"]=> + array(6) { + ["num"]=> + int(3) + ["type"]=> + string(5) "bytea" + ["len"]=> + int(-1) + ["not null"]=> + bool(false) + ["has default"]=> + bool(false) + ["array dims"]=> + int(0) + } +} \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-pgsql/12pg_insert.php b/hphp/test/zend/bad/ext-pgsql/12pg_insert.php new file mode 100644 index 000000000..600ea259d --- /dev/null +++ b/hphp/test/zend/bad/ext-pgsql/12pg_insert.php @@ -0,0 +1,13 @@ +'1234', 'str'=>'AAA', 'bin'=>'BBB'); + +pg_insert($db, $table_name, $fields) or print "Error in test 1\n"; +echo pg_insert($db, $table_name, $fields, PGSQL_DML_STRING)."\n"; + +echo "Ok\n"; +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-pgsql/12pg_insert.php.expectf b/hphp/test/zend/bad/ext-pgsql/12pg_insert.php.expectf new file mode 100644 index 000000000..9e84488ec --- /dev/null +++ b/hphp/test/zend/bad/ext-pgsql/12pg_insert.php.expectf @@ -0,0 +1,2 @@ +INSERT INTO php_pgsql_test (num,str,bin) VALUES (1234,'AAA','BBB'); +Ok \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-pgsql/12pg_insert_85.php b/hphp/test/zend/bad/ext-pgsql/12pg_insert_85.php new file mode 100644 index 000000000..600ea259d --- /dev/null +++ b/hphp/test/zend/bad/ext-pgsql/12pg_insert_85.php @@ -0,0 +1,13 @@ +'1234', 'str'=>'AAA', 'bin'=>'BBB'); + +pg_insert($db, $table_name, $fields) or print "Error in test 1\n"; +echo pg_insert($db, $table_name, $fields, PGSQL_DML_STRING)."\n"; + +echo "Ok\n"; +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-pgsql/12pg_insert_85.php.expectf b/hphp/test/zend/bad/ext-pgsql/12pg_insert_85.php.expectf new file mode 100644 index 000000000..e1dd7b890 --- /dev/null +++ b/hphp/test/zend/bad/ext-pgsql/12pg_insert_85.php.expectf @@ -0,0 +1,2 @@ +INSERT INTO php_pgsql_test (num,str,bin) VALUES (1234,'AAA','\\x424242'); +Ok \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-pgsql/13pg_select.php b/hphp/test/zend/bad/ext-pgsql/13pg_select.php new file mode 100644 index 000000000..4d251bc99 --- /dev/null +++ b/hphp/test/zend/bad/ext-pgsql/13pg_select.php @@ -0,0 +1,15 @@ +'1234', 'str'=>'ABC', 'bin'=>'XYZ'); +$ids = array('num'=>'1234'); + +$res = pg_select($db, $table_name, $ids) or print "Error\n"; +var_dump($res); +echo pg_select($db, $table_name, $ids, PGSQL_DML_STRING)."\n"; +echo "Ok\n"; + +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-pgsql/13pg_select.php.expectf b/hphp/test/zend/bad/ext-pgsql/13pg_select.php.expectf new file mode 100644 index 000000000..a8294e89e --- /dev/null +++ b/hphp/test/zend/bad/ext-pgsql/13pg_select.php.expectf @@ -0,0 +1,13 @@ +array(1) { + [0]=> + array(3) { + ["num"]=> + string(4) "1234" + ["str"]=> + string(3) "AAA" + ["bin"]=> + string(3) "BBB" + } +} +SELECT * FROM php_pgsql_test WHERE num=1234; +Ok \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-pgsql/13pg_select_85.php b/hphp/test/zend/bad/ext-pgsql/13pg_select_85.php new file mode 100644 index 000000000..4d251bc99 --- /dev/null +++ b/hphp/test/zend/bad/ext-pgsql/13pg_select_85.php @@ -0,0 +1,15 @@ +'1234', 'str'=>'ABC', 'bin'=>'XYZ'); +$ids = array('num'=>'1234'); + +$res = pg_select($db, $table_name, $ids) or print "Error\n"; +var_dump($res); +echo pg_select($db, $table_name, $ids, PGSQL_DML_STRING)."\n"; +echo "Ok\n"; + +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-pgsql/13pg_select_85.php.expectf b/hphp/test/zend/bad/ext-pgsql/13pg_select_85.php.expectf new file mode 100644 index 000000000..3d636c34a --- /dev/null +++ b/hphp/test/zend/bad/ext-pgsql/13pg_select_85.php.expectf @@ -0,0 +1,13 @@ +array(1) { + [0]=> + array(3) { + ["num"]=> + string(4) "1234" + ["str"]=> + string(3) "AAA" + ["bin"]=> + string(8) "\x424242" + } +} +SELECT * FROM php_pgsql_test WHERE num=1234; +Ok \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-pgsql/14pg_update.php b/hphp/test/zend/bad/ext-pgsql/14pg_update.php new file mode 100644 index 000000000..d44bef3ba --- /dev/null +++ b/hphp/test/zend/bad/ext-pgsql/14pg_update.php @@ -0,0 +1,14 @@ +'1234', 'str'=>'ABC', 'bin'=>'XYZ'); +$ids = array('num'=>'1234'); + +pg_update($db, $table_name, $fields, $ids) or print "Error in test 1\n"; +echo pg_update($db, $table_name, $fields, $ids, PGSQL_DML_STRING)."\n"; + +echo "Ok\n"; +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-pgsql/14pg_update.php.expectf b/hphp/test/zend/bad/ext-pgsql/14pg_update.php.expectf new file mode 100644 index 000000000..9f066687b --- /dev/null +++ b/hphp/test/zend/bad/ext-pgsql/14pg_update.php.expectf @@ -0,0 +1,2 @@ +UPDATE php_pgsql_test SET num=1234,str='ABC',bin='XYZ' WHERE num=1234; +Ok \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-pgsql/14pg_update_85.php b/hphp/test/zend/bad/ext-pgsql/14pg_update_85.php new file mode 100644 index 000000000..d44bef3ba --- /dev/null +++ b/hphp/test/zend/bad/ext-pgsql/14pg_update_85.php @@ -0,0 +1,14 @@ +'1234', 'str'=>'ABC', 'bin'=>'XYZ'); +$ids = array('num'=>'1234'); + +pg_update($db, $table_name, $fields, $ids) or print "Error in test 1\n"; +echo pg_update($db, $table_name, $fields, $ids, PGSQL_DML_STRING)."\n"; + +echo "Ok\n"; +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-pgsql/14pg_update_85.php.expectf b/hphp/test/zend/bad/ext-pgsql/14pg_update_85.php.expectf new file mode 100644 index 000000000..b2da8e63a --- /dev/null +++ b/hphp/test/zend/bad/ext-pgsql/14pg_update_85.php.expectf @@ -0,0 +1,2 @@ +UPDATE php_pgsql_test SET num=1234,str='ABC',bin='\\x58595a' WHERE num=1234; +Ok \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-pgsql/15pg_delete.php b/hphp/test/zend/bad/ext-pgsql/15pg_delete.php new file mode 100644 index 000000000..c9d35cedd --- /dev/null +++ b/hphp/test/zend/bad/ext-pgsql/15pg_delete.php @@ -0,0 +1,16 @@ +'1234', 'str'=>'XXX', 'bin'=>'YYY'); +$ids = array('num'=>'1234'); +if (!pg_delete($db, $table_name, $ids)) { + echo "Error\n"; +} +else { + echo "Ok\n"; +} +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-pgsql/15pg_delete.php.expectf b/hphp/test/zend/bad/ext-pgsql/15pg_delete.php.expectf new file mode 100644 index 000000000..077fd6560 --- /dev/null +++ b/hphp/test/zend/bad/ext-pgsql/15pg_delete.php.expectf @@ -0,0 +1 @@ +Ok \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-pgsql/16pg_result_status.php b/hphp/test/zend/bad/ext-pgsql/16pg_result_status.php new file mode 100644 index 000000000..a8d5d3eab --- /dev/null +++ b/hphp/test/zend/bad/ext-pgsql/16pg_result_status.php @@ -0,0 +1,11 @@ + \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-pgsql/16pg_result_status.php.expectf b/hphp/test/zend/bad/ext-pgsql/16pg_result_status.php.expectf new file mode 100644 index 000000000..68fd220a1 --- /dev/null +++ b/hphp/test/zend/bad/ext-pgsql/16pg_result_status.php.expectf @@ -0,0 +1,2 @@ +1 +COMMIT \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-pgsql/17result.php b/hphp/test/zend/bad/ext-pgsql/17result.php new file mode 100644 index 000000000..9e9d21548 --- /dev/null +++ b/hphp/test/zend/bad/ext-pgsql/17result.php @@ -0,0 +1,20 @@ + \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-pgsql/17result.php.expectf b/hphp/test/zend/bad/ext-pgsql/17result.php.expectf new file mode 100644 index 000000000..ae59516c3 --- /dev/null +++ b/hphp/test/zend/bad/ext-pgsql/17result.php.expectf @@ -0,0 +1,41 @@ +bool(true) +object(stdClass)#1 (3) { + ["num"]=> + string(1) "1" + ["str"]=> + string(3) "ABC" + ["bin"]=> + NULL +} +array(6) { + [0]=> + string(1) "1" + ["num"]=> + string(1) "1" + [1]=> + string(3) "ABC" + ["str"]=> + string(3) "ABC" + [2]=> + NULL + ["bin"]=> + NULL +} +array(3) { + [0]=> + string(1) "1" + [1]=> + string(3) "ABC" + [2]=> + NULL +} +array(3) { + ["num"]=> + string(1) "1" + ["str"]=> + string(3) "ABC" + ["bin"]=> + NULL +} +bool(true) +Ok \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-pgsql/18pg_escape_bytea.php b/hphp/test/zend/bad/ext-pgsql/18pg_escape_bytea.php new file mode 100644 index 000000000..cf9dbaa80 --- /dev/null +++ b/hphp/test/zend/bad/ext-pgsql/18pg_escape_bytea.php @@ -0,0 +1,21 @@ + \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-pgsql/18pg_escape_bytea.php.expectf b/hphp/test/zend/bad/ext-pgsql/18pg_escape_bytea.php.expectf new file mode 100644 index 000000000..a0aba9318 --- /dev/null +++ b/hphp/test/zend/bad/ext-pgsql/18pg_escape_bytea.php.expectf @@ -0,0 +1 @@ +OK \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-pgsql/19pg_ping.php b/hphp/test/zend/bad/ext-pgsql/19pg_ping.php new file mode 100644 index 000000000..a3b8cdfab --- /dev/null +++ b/hphp/test/zend/bad/ext-pgsql/19pg_ping.php @@ -0,0 +1,8 @@ + \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-pgsql/19pg_ping.php.expectf b/hphp/test/zend/bad/ext-pgsql/19pg_ping.php.expectf new file mode 100644 index 000000000..254d25151 --- /dev/null +++ b/hphp/test/zend/bad/ext-pgsql/19pg_ping.php.expectf @@ -0,0 +1 @@ +bool(true) \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-pgsql/20pg_get_pid.php b/hphp/test/zend/bad/ext-pgsql/20pg_get_pid.php new file mode 100644 index 000000000..2b68e47a3 --- /dev/null +++ b/hphp/test/zend/bad/ext-pgsql/20pg_get_pid.php @@ -0,0 +1,10 @@ + \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-pgsql/20pg_get_pid.php.expectf b/hphp/test/zend/bad/ext-pgsql/20pg_get_pid.php.expectf new file mode 100644 index 000000000..a0aba9318 --- /dev/null +++ b/hphp/test/zend/bad/ext-pgsql/20pg_get_pid.php.expectf @@ -0,0 +1 @@ +OK \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-pgsql/21pg_get_notify.php b/hphp/test/zend/bad/ext-pgsql/21pg_get_notify.php new file mode 100644 index 000000000..9fce005a2 --- /dev/null +++ b/hphp/test/zend/bad/ext-pgsql/21pg_get_notify.php @@ -0,0 +1,13 @@ + \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-pgsql/21pg_get_notify.php.expectf b/hphp/test/zend/bad/ext-pgsql/21pg_get_notify.php.expectf new file mode 100644 index 000000000..a0aba9318 --- /dev/null +++ b/hphp/test/zend/bad/ext-pgsql/21pg_get_notify.php.expectf @@ -0,0 +1 @@ +OK \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-pgsql/22pg_fetch_object.php b/hphp/test/zend/bad/ext-pgsql/22pg_fetch_object.php new file mode 100644 index 000000000..42474c588 --- /dev/null +++ b/hphp/test/zend/bad/ext-pgsql/22pg_fetch_object.php @@ -0,0 +1,21 @@ + \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-pgsql/22pg_fetch_object.php.expectf b/hphp/test/zend/bad/ext-pgsql/22pg_fetch_object.php.expectf new file mode 100644 index 000000000..fd34a1531 --- /dev/null +++ b/hphp/test/zend/bad/ext-pgsql/22pg_fetch_object.php.expectf @@ -0,0 +1,10 @@ +test_class::__construct(1,2) +object(test_class)#1 (3) { + ["num"]=> + string(1) "0" + ["str"]=> + string(3) "ABC" + ["bin"]=> + NULL +} +Ok \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-pgsql/23sync_query_params.php b/hphp/test/zend/bad/ext-pgsql/23sync_query_params.php new file mode 100644 index 000000000..230c3bf3d --- /dev/null +++ b/hphp/test/zend/bad/ext-pgsql/23sync_query_params.php @@ -0,0 +1,49 @@ += 3) { + $result = pg_query_params($db, "SELECT * FROM ".$table_name." WHERE num > \$1;", array(100)); + if (!($rows = pg_num_rows($result))) + { + echo "pg_num_row() error\n"; + } + for ($i=0; $i < $rows; $i++) + { + pg_fetch_array($result, $i, PGSQL_NUM); + } + for ($i=0; $i < $rows; $i++) + { + pg_fetch_object($result); + } + for ($i=0; $i < $rows; $i++) + { + pg_fetch_row($result, $i); + } + for ($i=0; $i < $rows; $i++) + { + pg_fetch_result($result, $i, 0); + } + + pg_result_error($result); + pg_num_rows(pg_query_params($db, "SELECT * FROM ".$table_name." WHERE num > \$1;", array(100))); + pg_num_fields(pg_query_params($db, "SELECT * FROM ".$table_name." WHERE num > \$1;", array(100))); + pg_field_name($result, 0); + pg_field_num($result, $field_name); + pg_field_size($result, 0); + pg_field_type($result, 0); + pg_field_prtlen($result, 0); + pg_field_is_null($result, 0); + + $result = pg_query_params($db, "INSERT INTO ".$table_name." VALUES (\$1, \$2);", array(9999, "A'BC")); + pg_last_oid($result); + + pg_free_result($result); +} +pg_close($db); + +echo "OK"; +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-pgsql/23sync_query_params.php.expectf b/hphp/test/zend/bad/ext-pgsql/23sync_query_params.php.expectf new file mode 100644 index 000000000..a0aba9318 --- /dev/null +++ b/hphp/test/zend/bad/ext-pgsql/23sync_query_params.php.expectf @@ -0,0 +1 @@ +OK \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-pgsql/24sync_query_prepared.php b/hphp/test/zend/bad/ext-pgsql/24sync_query_prepared.php new file mode 100644 index 000000000..65b93f423 --- /dev/null +++ b/hphp/test/zend/bad/ext-pgsql/24sync_query_prepared.php @@ -0,0 +1,55 @@ += 3) { + $result = pg_prepare($db, "php_test", "SELECT * FROM ".$table_name." WHERE num > \$1;"); + pg_result_error($result); + pg_free_result($result); + $result = pg_execute($db, "php_test", array(100)); + if (!($rows = pg_num_rows($result))) + { + echo "pg_num_row() error\n"; + } + for ($i=0; $i < $rows; $i++) + { + pg_fetch_array($result, $i, PGSQL_NUM); + } + for ($i=0; $i < $rows; $i++) + { + pg_fetch_object($result); + } + for ($i=0; $i < $rows; $i++) + { + pg_fetch_row($result, $i); + } + for ($i=0; $i < $rows; $i++) + { + pg_fetch_result($result, $i, 0); + } + + pg_result_error($result); + pg_num_rows(pg_execute($db, "php_test", array(100))); + pg_num_fields(pg_execute($db, "php_test", array(100))); + pg_field_name($result, 0); + pg_field_num($result, $field_name); + pg_field_size($result, 0); + pg_field_type($result, 0); + pg_field_prtlen($result, 0); + pg_field_is_null($result, 0); + + $result = pg_prepare($db, "php_test2", "INSERT INTO ".$table_name." VALUES (\$1, \$2);"); + pg_result_error($result); + pg_free_result($result); + $result = pg_execute($db, "php_test2", array(9999, "A'BC")); + pg_last_oid($result); + + pg_free_result($result); +} +pg_close($db); + +echo "OK"; +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-pgsql/24sync_query_prepared.php.expectf b/hphp/test/zend/bad/ext-pgsql/24sync_query_prepared.php.expectf new file mode 100644 index 000000000..a0aba9318 --- /dev/null +++ b/hphp/test/zend/bad/ext-pgsql/24sync_query_prepared.php.expectf @@ -0,0 +1 @@ +OK \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-pgsql/25async_query_params.php b/hphp/test/zend/bad/ext-pgsql/25async_query_params.php new file mode 100644 index 000000000..95c4b08b0 --- /dev/null +++ b/hphp/test/zend/bad/ext-pgsql/25async_query_params.php @@ -0,0 +1,60 @@ += 3) { + if (!pg_send_query_params($db, "SELECT * FROM ".$table_name." WHERE num > \$1;", array(100))) { + echo "pg_send_query_params() error\n"; + } + while(pg_connection_busy($db)); // busy wait: intended + if (pg_connection_status($db) === PGSQL_CONNECTION_BAD) { + echo "pg_connection_status() error\n"; + } + if (!($result = pg_get_result($db))) + { + echo "pg_get_result() error\n"; + } + if (!($rows = pg_num_rows($result))) { + echo "pg_num_rows() error\n"; + } + for ($i=0; $i < $rows; $i++) + { + pg_fetch_array($result, $i, PGSQL_NUM); + } + for ($i=0; $i < $rows; $i++) + { + pg_fetch_object($result); + } + for ($i=0; $i < $rows; $i++) + { + pg_fetch_row($result, $i); + } + for ($i=0; $i < $rows; $i++) + { + pg_fetch_result($result, $i, 0); + } + + pg_num_rows(pg_query_params($db, "SELECT * FROM ".$table_name." WHERE num > \$1;", array(100))); + pg_num_fields(pg_query_params($db, "SELECT * FROM ".$table_name." WHERE num > \$1;", array(100))); + pg_field_name($result, 0); + pg_field_num($result, $field_name); + pg_field_size($result, 0); + pg_field_type($result, 0); + pg_field_prtlen($result, 0); + pg_field_is_null($result, 0); + + if (!pg_send_query_params($db, "INSERT INTO ".$table_name." VALUES (\$1, \$2);", array(9999, "A'BC"))) + { + echo "pg_send_query_params() error\n"; + } + + pg_last_oid($result); + pg_free_result($result); +} +pg_close($db); + +echo "OK"; +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-pgsql/25async_query_params.php.expectf b/hphp/test/zend/bad/ext-pgsql/25async_query_params.php.expectf new file mode 100644 index 000000000..a0aba9318 --- /dev/null +++ b/hphp/test/zend/bad/ext-pgsql/25async_query_params.php.expectf @@ -0,0 +1 @@ +OK \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-pgsql/26async_query_prepared.php b/hphp/test/zend/bad/ext-pgsql/26async_query_prepared.php new file mode 100644 index 000000000..0bc1e9263 --- /dev/null +++ b/hphp/test/zend/bad/ext-pgsql/26async_query_prepared.php @@ -0,0 +1,96 @@ += 3) { + if (!pg_send_prepare($db, 'php_test', "SELECT * FROM ".$table_name." WHERE num > \$1;")) { + echo "pg_send_prepare() error\n"; + } + while(pg_connection_busy($db)); // busy wait: intended + if (pg_connection_status($db) === PGSQL_CONNECTION_BAD) { + echo "pg_connection_status() error\n"; + } + if (!($result = pg_get_result($db))) + { + echo "pg_get_result() error\n"; + } + pg_free_result($result); + + if (!pg_send_execute($db, 'php_test', array(100))) { + echo "pg_send_execute() error\n"; + } + while(pg_connection_busy($db)); // busy wait: intended + if (pg_connection_status($db) === PGSQL_CONNECTION_BAD) { + echo "pg_connection_status() error\n"; + } + if (!($result = pg_get_result($db))) + { + echo "pg_get_result() error\n"; + } + + if (!($rows = pg_num_rows($result))) { + echo "pg_num_rows() error\n"; + } + for ($i=0; $i < $rows; $i++) + { + pg_fetch_array($result, $i, PGSQL_NUM); + } + for ($i=0; $i < $rows; $i++) + { + pg_fetch_object($result); + } + for ($i=0; $i < $rows; $i++) + { + pg_fetch_row($result, $i); + } + for ($i=0; $i < $rows; $i++) + { + pg_fetch_result($result, $i, 0); + } + + pg_num_rows(pg_query_params($db, "SELECT * FROM ".$table_name." WHERE num > \$1;", array(100))); + pg_num_fields(pg_query_params($db, "SELECT * FROM ".$table_name." WHERE num > \$1;", array(100))); + pg_field_name($result, 0); + pg_field_num($result, $field_name); + pg_field_size($result, 0); + pg_field_type($result, 0); + pg_field_prtlen($result, 0); + pg_field_is_null($result, 0); + + if (!pg_send_prepare($db, "php_test2", "INSERT INTO ".$table_name." VALUES (\$1, \$2);")) + { + echo "pg_send_prepare() error\n"; + } + while(pg_connection_busy($db)); // busy wait: intended + if (pg_connection_status($db) === PGSQL_CONNECTION_BAD) { + echo "pg_connection_status() error\n"; + } + if (!($result = pg_get_result($db))) + { + echo "pg_get_result() error\n"; + } + pg_free_result($result); + + if (!pg_send_execute($db, "php_test2", array(9999, "A'BC"))) + { + echo "pg_send_execute() error\n"; + } + while(pg_connection_busy($db)); // busy wait: intended + if (pg_connection_status($db) === PGSQL_CONNECTION_BAD) { + echo "pg_connection_status() error\n"; + } + if (!($result = pg_get_result($db))) + { + echo "pg_get_result() error\n"; + } + + pg_last_oid($result); + pg_free_result($result); +} +pg_close($db); + +echo "OK"; +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-pgsql/26async_query_prepared.php.expectf b/hphp/test/zend/bad/ext-pgsql/26async_query_prepared.php.expectf new file mode 100644 index 000000000..a0aba9318 --- /dev/null +++ b/hphp/test/zend/bad/ext-pgsql/26async_query_prepared.php.expectf @@ -0,0 +1 @@ +OK \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-pgsql/27large_object_oid.php b/hphp/test/zend/bad/ext-pgsql/27large_object_oid.php new file mode 100644 index 000000000..3fb602ed7 --- /dev/null +++ b/hphp/test/zend/bad/ext-pgsql/27large_object_oid.php @@ -0,0 +1,32 @@ + \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-pgsql/27large_object_oid.php.expectf b/hphp/test/zend/bad/ext-pgsql/27large_object_oid.php.expectf new file mode 100644 index 000000000..515d7de34 --- /dev/null +++ b/hphp/test/zend/bad/ext-pgsql/27large_object_oid.php.expectf @@ -0,0 +1,4 @@ +create LO from int +create LO from string +create LO using default connection +OK \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-pgsql/28large_object_import_oid.php b/hphp/test/zend/bad/ext-pgsql/28large_object_import_oid.php new file mode 100644 index 000000000..6b707c60b --- /dev/null +++ b/hphp/test/zend/bad/ext-pgsql/28large_object_import_oid.php @@ -0,0 +1,33 @@ + \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-pgsql/28large_object_import_oid.php.expectf b/hphp/test/zend/bad/ext-pgsql/28large_object_import_oid.php.expectf new file mode 100644 index 000000000..6a81ce41d --- /dev/null +++ b/hphp/test/zend/bad/ext-pgsql/28large_object_import_oid.php.expectf @@ -0,0 +1,4 @@ +import LO from int +import LO from string +import LO using default connection +OK \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-pgsql/80_bug14383.php b/hphp/test/zend/bad/ext-pgsql/80_bug14383.php new file mode 100644 index 000000000..272c2536f --- /dev/null +++ b/hphp/test/zend/bad/ext-pgsql/80_bug14383.php @@ -0,0 +1,13 @@ + \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-pgsql/80_bug14383.php.expectf b/hphp/test/zend/bad/ext-pgsql/80_bug14383.php.expectf new file mode 100644 index 000000000..7035e43e6 --- /dev/null +++ b/hphp/test/zend/bad/ext-pgsql/80_bug14383.php.expectf @@ -0,0 +1,30 @@ +database handler: %s +3NYNYY +Content String 2 +Content 2 replaced +Read during write:%sallowed +Content 2 replaced 2nd time +The 6th value +array(3) { + ["key number 6"]=> + string(13) "The 6th value" + ["key2"]=> + string(27) "Content 2 replaced 2nd time" + ["key5"]=> + string(23) "The last content string" +} +--NO-LOCK-- +3NYNYY +Content String 2 +Content 2 replaced +Read during write: not allowed +Content 2 replaced 2nd time +The 6th value +array(3) { + ["key number 6"]=> + string(13) "The 6th value" + ["key2"]=> + string(27) "Content 2 replaced 2nd time" + ["key5"]=> + string(23) "The last content string" +} \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-pgsql/80_bug24499.php b/hphp/test/zend/bad/ext-pgsql/80_bug24499.php new file mode 100644 index 000000000..98e1be76f --- /dev/null +++ b/hphp/test/zend/bad/ext-pgsql/80_bug24499.php @@ -0,0 +1,42 @@ +id; + } +} + +$id = new Id(); +var_dump($id->getId()); + +pg_close($dbh); + +echo "Done\n"; + +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-pgsql/80_bug24499.php.expectf b/hphp/test/zend/bad/ext-pgsql/80_bug24499.php.expectf new file mode 100644 index 000000000..c282e3eb4 --- /dev/null +++ b/hphp/test/zend/bad/ext-pgsql/80_bug24499.php.expectf @@ -0,0 +1,16 @@ +Array +( + [0] => 1 + [id] => 1 +) +Array +( + [0] => 2 + [id] => 2 +) +object(stdClass)#%d (1) { + ["id"]=> + string(1) "3" +} +string(1) "3" +Done \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-pgsql/80_bug27597.php b/hphp/test/zend/bad/ext-pgsql/80_bug27597.php new file mode 100644 index 000000000..8dae67beb --- /dev/null +++ b/hphp/test/zend/bad/ext-pgsql/80_bug27597.php @@ -0,0 +1,35 @@ + 4) { + echo "ENDLESS-LOOP"; + exit(1); + } +} + +pg_close($dbh); + +?> +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-pgsql/80_bug27597.php.expectf b/hphp/test/zend/bad/ext-pgsql/80_bug27597.php.expectf new file mode 100644 index 000000000..fc609dde3 --- /dev/null +++ b/hphp/test/zend/bad/ext-pgsql/80_bug27597.php.expectf @@ -0,0 +1,17 @@ +Array +( + [id] => 0 +) +Array +( + [id] => 1 +) +Array +( + [id] => 2 +) +Array +( + [id] => 3 +) +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-pgsql/80_bug32223.php b/hphp/test/zend/bad/ext-pgsql/80_bug32223.php new file mode 100644 index 000000000..40bf29bd5 --- /dev/null +++ b/hphp/test/zend/bad/ext-pgsql/80_bug32223.php @@ -0,0 +1,33 @@ + +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-pgsql/80_bug32223.php.expectf b/hphp/test/zend/bad/ext-pgsql/80_bug32223.php.expectf new file mode 100644 index 000000000..e3fd7c294 --- /dev/null +++ b/hphp/test/zend/bad/ext-pgsql/80_bug32223.php.expectf @@ -0,0 +1,6 @@ +array(1) { + [0]=> + string(1) "f" +} +string(14) "NOTICE: 11111" +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-pgsql/80_bug32223b.php b/hphp/test/zend/bad/ext-pgsql/80_bug32223b.php new file mode 100644 index 000000000..731fc762a --- /dev/null +++ b/hphp/test/zend/bad/ext-pgsql/80_bug32223b.php @@ -0,0 +1,35 @@ + +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-pgsql/80_bug32223b.php.expectf b/hphp/test/zend/bad/ext-pgsql/80_bug32223b.php.expectf new file mode 100644 index 000000000..e3fd7c294 --- /dev/null +++ b/hphp/test/zend/bad/ext-pgsql/80_bug32223b.php.expectf @@ -0,0 +1,6 @@ +array(1) { + [0]=> + string(1) "f" +} +string(14) "NOTICE: 11111" +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-pgsql/80_bug36625.php b/hphp/test/zend/bad/ext-pgsql/80_bug36625.php new file mode 100644 index 000000000..ba4e2d238 --- /dev/null +++ b/hphp/test/zend/bad/ext-pgsql/80_bug36625.php @@ -0,0 +1,34 @@ + 0); +var_dump(file_exists($tracefile)); + +?> +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-pgsql/80_bug36625.php.expectf b/hphp/test/zend/bad/ext-pgsql/80_bug36625.php.expectf new file mode 100644 index 000000000..e433b3719 --- /dev/null +++ b/hphp/test/zend/bad/ext-pgsql/80_bug36625.php.expectf @@ -0,0 +1,5 @@ +bool(false) +resource(%d) of type (pgsql result) +bool(true) +bool(true) +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-pgsql/80_bug39971.php b/hphp/test/zend/bad/ext-pgsql/80_bug39971.php new file mode 100644 index 000000000..829c38fbc --- /dev/null +++ b/hphp/test/zend/bad/ext-pgsql/80_bug39971.php @@ -0,0 +1,21 @@ + 'now()'); +pg_insert($dbh, 'php_test', $values); + +$ids = array('id' => 1); +pg_update($dbh, 'php_test', $values, $ids); + +pg_query($dbh, "DROP TABLE php_test"); +pg_close($dbh); +?> +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-pgsql/80_bug39971.php.expectf b/hphp/test/zend/bad/ext-pgsql/80_bug39971.php.expectf new file mode 100644 index 000000000..922a780ce --- /dev/null +++ b/hphp/test/zend/bad/ext-pgsql/80_bug39971.php.expectf @@ -0,0 +1 @@ +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-pgsql/80_bug42783.php b/hphp/test/zend/bad/ext-pgsql/80_bug42783.php new file mode 100644 index 000000000..6b970f5a0 --- /dev/null +++ b/hphp/test/zend/bad/ext-pgsql/80_bug42783.php @@ -0,0 +1,19 @@ + +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-pgsql/80_bug42783.php.expectf b/hphp/test/zend/bad/ext-pgsql/80_bug42783.php.expectf new file mode 100644 index 000000000..188702b7c --- /dev/null +++ b/hphp/test/zend/bad/ext-pgsql/80_bug42783.php.expectf @@ -0,0 +1,7 @@ +array(2) { + ["id"]=> + string(%d) "%d" + ["time"]=> + string(%d) "%s" +} +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-pgsql/98old_api.php b/hphp/test/zend/bad/ext-pgsql/98old_api.php new file mode 100644 index 000000000..c87df2fe1 --- /dev/null +++ b/hphp/test/zend/bad/ext-pgsql/98old_api.php @@ -0,0 +1,26 @@ + \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-pgsql/98old_api.php.expectf b/hphp/test/zend/bad/ext-pgsql/98old_api.php.expectf new file mode 100644 index 000000000..a0aba9318 --- /dev/null +++ b/hphp/test/zend/bad/ext-pgsql/98old_api.php.expectf @@ -0,0 +1 @@ +OK \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-pgsql/9999dropdb.php b/hphp/test/zend/bad/ext-pgsql/9999dropdb.php new file mode 100644 index 000000000..eaf33ae74 --- /dev/null +++ b/hphp/test/zend/bad/ext-pgsql/9999dropdb.php @@ -0,0 +1,11 @@ + \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-pgsql/9999dropdb.php.expectf b/hphp/test/zend/bad/ext-pgsql/9999dropdb.php.expectf new file mode 100644 index 000000000..a0aba9318 --- /dev/null +++ b/hphp/test/zend/bad/ext-pgsql/9999dropdb.php.expectf @@ -0,0 +1 @@ +OK \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-pgsql/bug37100.php b/hphp/test/zend/bad/ext-pgsql/bug37100.php new file mode 100644 index 000000000..960f00466 --- /dev/null +++ b/hphp/test/zend/bad/ext-pgsql/bug37100.php @@ -0,0 +1,33 @@ + \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-pgsql/bug37100.php.expectf b/hphp/test/zend/bad/ext-pgsql/bug37100.php.expectf new file mode 100644 index 000000000..fc73ae88e --- /dev/null +++ b/hphp/test/zend/bad/ext-pgsql/bug37100.php.expectf @@ -0,0 +1,4 @@ +string(24) "\001\003\252\000\010\022" +string(12) "0103aa000812" +int(6) +string(12) "0103aa000812" \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-pgsql/bug37100_85.php b/hphp/test/zend/bad/ext-pgsql/bug37100_85.php new file mode 100644 index 000000000..960f00466 --- /dev/null +++ b/hphp/test/zend/bad/ext-pgsql/bug37100_85.php @@ -0,0 +1,33 @@ + \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-pgsql/bug37100_85.php.expectf b/hphp/test/zend/bad/ext-pgsql/bug37100_85.php.expectf new file mode 100644 index 000000000..430d0a9cd --- /dev/null +++ b/hphp/test/zend/bad/ext-pgsql/bug37100_85.php.expectf @@ -0,0 +1,4 @@ +string(14) "\x0103aa000812" +string(12) "0103aa000812" +int(6) +string(12) "0103aa000812" \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-pgsql/bug47199.php b/hphp/test/zend/bad/ext-pgsql/bug47199.php new file mode 100644 index 000000000..506408452 --- /dev/null +++ b/hphp/test/zend/bad/ext-pgsql/bug47199.php @@ -0,0 +1,30 @@ + null, 'not_null_field' => 1)); +pg_insert($dbh, $tbl_name, array('null_field' => null, 'not_null_field' => 2)); + +var_dump(pg_fetch_all(pg_query('SELECT * FROM '. $tbl_name))); + +$query = pg_delete($dbh, $tbl_name, array('null_field' => NULL,'not_null_field' => 2), PGSQL_DML_STRING|PGSQL_DML_EXEC); + +echo $query, "\n"; + +$query = pg_update($dbh, $tbl_name, array('null_field' => NULL, 'not_null_field' => 0), array('not_null_field' => 1, 'null_field' => ''), PGSQL_DML_STRING|PGSQL_DML_EXEC); + +echo $query, "\n"; + +var_dump(pg_fetch_all(pg_query('SELECT * FROM '. $tbl_name))); + +@pg_query("DROP TABLE $tbl_name"); +pg_close($dbh); + +echo PHP_EOL."Done".PHP_EOL; + +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-pgsql/bug47199.php.expectf b/hphp/test/zend/bad/ext-pgsql/bug47199.php.expectf new file mode 100644 index 000000000..9f3a4eb05 --- /dev/null +++ b/hphp/test/zend/bad/ext-pgsql/bug47199.php.expectf @@ -0,0 +1,29 @@ +array(2) { + [0]=> + array(2) { + ["null_field"]=> + NULL + ["not_null_field"]=> + string(1) "1" + } + [1]=> + array(2) { + ["null_field"]=> + NULL + ["not_null_field"]=> + string(1) "2" + } +} +DELETE FROM test_47199 WHERE null_field IS NULL AND not_null_field=2; +UPDATE test_47199 SET null_field=NULL,not_null_field=0 WHERE not_null_field=1 AND null_field IS NULL; +array(1) { + [0]=> + array(2) { + ["null_field"]=> + NULL + ["not_null_field"]=> + string(1) "0" + } +} + +Done \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-pgsql/bug60244.php b/hphp/test/zend/bad/ext-pgsql/bug60244.php new file mode 100644 index 000000000..85311358c --- /dev/null +++ b/hphp/test/zend/bad/ext-pgsql/bug60244.php @@ -0,0 +1,20 @@ + \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-pgsql/bug60244.php.expectf b/hphp/test/zend/bad/ext-pgsql/bug60244.php.expectf new file mode 100644 index 000000000..1d9d31874 --- /dev/null +++ b/hphp/test/zend/bad/ext-pgsql/bug60244.php.expectf @@ -0,0 +1,26 @@ +HipHop Warning: %a +bool(false) +HipHop Warning: %a +bool(false) +HipHop Warning: %a +bool(false) +HipHop Warning: %a +bool(false) +array(2) { + [0]=> + string(1) "a" + ["?column?"]=> + string(1) "a" +} +array(1) { + ["?column?"]=> + string(1) "a" +} +object(stdClass)#1 (1) { + ["?column?"]=> + string(1) "a" +} +array(1) { + [0]=> + string(1) "a" +} \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-pgsql/pg_delete_001.php b/hphp/test/zend/bad/ext-pgsql/pg_delete_001.php new file mode 100644 index 000000000..f56e97114 --- /dev/null +++ b/hphp/test/zend/bad/ext-pgsql/pg_delete_001.php @@ -0,0 +1,41 @@ + 1, 'id2' => 1)); +pg_insert($conn, 'foo', array('id' => 1, 'id2' => 2)); +pg_insert($conn, 'foo', array('id' => 1, 'id2' => 2)); +pg_insert($conn, 'foo', array('id' => 3, 'id2' => 3)); + +pg_insert($conn, 'phptests.foo', array('id' => 1, 'id2' => 1)); +pg_insert($conn, 'phptests.foo', array('id' => 1, 'id2' => 2)); +pg_insert($conn, 'phptests.foo', array('id' => 2, 'id2' => 3)); +pg_insert($conn, 'phptests.foo', array('id' => 2, 'id2' => 3)); + +pg_delete($conn, 'foo', array('id' => 1, 'id2' => 0)); +pg_delete($conn, 'foo', array('id' => 1, 'id2' => 2)); +var_dump(pg_delete($conn, 'foo', array('id' => 1, 'id2' => 2), PGSQL_DML_STRING)); + +pg_delete($conn, 'phptests.foo', array('id' => 2, 'id2' => 1)); +pg_delete($conn, 'phptests.foo', array('id' => 2, 'id2' => 3)); +var_dump(pg_delete($conn, 'phptests.foo', array('id' => 2, 'id2' => 3), PGSQL_DML_STRING)); + +var_dump(pg_fetch_all(pg_query('SELECT * FROM foo'))); +var_dump(pg_fetch_all(pg_query('SELECT * FROM phptests.foo'))); + +/* Inexistent */ +pg_delete($conn, 'bar', array('id' => 1, 'id2' => 2)); +var_dump(pg_delete($conn, 'bar', array('id' => 1, 'id2' => 2), PGSQL_DML_STRING)); + +pg_query('DROP TABLE foo'); +pg_query('DROP TABLE phptests.foo'); +pg_query('DROP SCHEMA phptests'); + +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-pgsql/pg_delete_001.php.expectf b/hphp/test/zend/bad/ext-pgsql/pg_delete_001.php.expectf new file mode 100644 index 000000000..ed22e2afa --- /dev/null +++ b/hphp/test/zend/bad/ext-pgsql/pg_delete_001.php.expectf @@ -0,0 +1,37 @@ +string(37) "DELETE FROM foo WHERE id=1 AND id2=2;" +string(46) "DELETE FROM phptests.foo WHERE id=2 AND id2=3;" +array(2) { + [0]=> + array(2) { + ["id"]=> + string(1) "1" + ["id2"]=> + string(1) "1" + } + [1]=> + array(2) { + ["id"]=> + string(1) "3" + ["id2"]=> + string(1) "3" + } +} +array(2) { + [0]=> + array(2) { + ["id"]=> + string(1) "1" + ["id2"]=> + string(1) "1" + } + [1]=> + array(2) { + ["id"]=> + string(1) "1" + ["id2"]=> + string(1) "2" + } +} +HipHop Warning: %a +HipHop Warning: %a +bool(false) \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-pgsql/pg_insert_001.php b/hphp/test/zend/bad/ext-pgsql/pg_insert_001.php new file mode 100644 index 000000000..dad571165 --- /dev/null +++ b/hphp/test/zend/bad/ext-pgsql/pg_insert_001.php @@ -0,0 +1,22 @@ + 1, 'id2' => 1)); + +pg_insert($conn, 'phptests.foo', array('id' => 1, 'id2' => 2)); + +var_dump(pg_insert($conn, 'phptests.foo', array('id' => 1, 'id2' => 2), PGSQL_DML_STRING)); + +var_dump(pg_select($conn, 'phptests.foo', array('id' => 1))); + +pg_query('DROP TABLE phptests.foo'); +pg_query('DROP SCHEMA phptests'); + +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-pgsql/pg_insert_001.php.expectf b/hphp/test/zend/bad/ext-pgsql/pg_insert_001.php.expectf new file mode 100644 index 000000000..3f5e02370 --- /dev/null +++ b/hphp/test/zend/bad/ext-pgsql/pg_insert_001.php.expectf @@ -0,0 +1,11 @@ +HipHop Warning: %a +string(47) "INSERT INTO phptests.foo (id,id2) VALUES (1,2);" +array(1) { + [0]=> + array(2) { + ["id"]=> + string(1) "1" + ["id2"]=> + string(1) "2" + } +} \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-pgsql/pg_meta_data_001.php b/hphp/test/zend/bad/ext-pgsql/pg_meta_data_001.php new file mode 100644 index 000000000..e73b61772 --- /dev/null +++ b/hphp/test/zend/bad/ext-pgsql/pg_meta_data_001.php @@ -0,0 +1,22 @@ + \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-pgsql/pg_meta_data_001.php.expectf b/hphp/test/zend/bad/ext-pgsql/pg_meta_data_001.php.expectf new file mode 100644 index 000000000..0fa7f714a --- /dev/null +++ b/hphp/test/zend/bad/ext-pgsql/pg_meta_data_001.php.expectf @@ -0,0 +1,64 @@ +array(2) { + ["id"]=> + array(6) { + ["num"]=> + int(1) + ["type"]=> + string(4) "int4" + ["len"]=> + int(4) + ["not null"]=> + bool(false) + ["has default"]=> + bool(false) + ["array dims"]=> + int(0) + } + ["id3"]=> + array(6) { + ["num"]=> + int(2) + ["type"]=> + string(4) "int4" + ["len"]=> + int(4) + ["not null"]=> + bool(false) + ["has default"]=> + bool(false) + ["array dims"]=> + int(0) + } +} +array(2) { + ["id"]=> + array(6) { + ["num"]=> + int(1) + ["type"]=> + string(4) "int4" + ["len"]=> + int(4) + ["not null"]=> + bool(false) + ["has default"]=> + bool(false) + ["array dims"]=> + int(0) + } + ["id2"]=> + array(6) { + ["num"]=> + int(2) + ["type"]=> + string(4) "int4" + ["len"]=> + int(4) + ["not null"]=> + bool(false) + ["has default"]=> + bool(false) + ["array dims"]=> + int(0) + } +} \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-pgsql/pg_select_001.php b/hphp/test/zend/bad/ext-pgsql/pg_select_001.php new file mode 100644 index 000000000..9edd8a307 --- /dev/null +++ b/hphp/test/zend/bad/ext-pgsql/pg_select_001.php @@ -0,0 +1,34 @@ + 1))); + +/* Existent column */ +var_dump(pg_select($conn, 'phptests.foo', array('id' => 1))); + +/* Testing with inexistent column */ +var_dump(pg_select($conn, 'phptests.bar', array('id' => 1))); + +/* Existent column */ +var_dump(pg_select($conn, 'phptests.bar', array('id4' => 4))); + + +pg_query('DROP TABLE phptests.foo'); +pg_query('DROP TABLE phptests.bar'); +pg_query('DROP SCHEMA phptests'); + +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-pgsql/pg_select_001.php.expectf b/hphp/test/zend/bad/ext-pgsql/pg_select_001.php.expectf new file mode 100644 index 000000000..5c5fa3064 --- /dev/null +++ b/hphp/test/zend/bad/ext-pgsql/pg_select_001.php.expectf @@ -0,0 +1,22 @@ +HipHop Warning: %a +bool(false) +array(1) { + [0]=> + array(2) { + ["id"]=> + string(1) "1" + ["id2"]=> + string(1) "2" + } +} +HipHop Notice: %a +bool(false) +array(1) { + [0]=> + array(2) { + ["id4"]=> + string(1) "4" + ["id3"]=> + string(1) "5" + } +} \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-pgsql/pg_update_001.php b/hphp/test/zend/bad/ext-pgsql/pg_update_001.php new file mode 100644 index 000000000..0ca76ea46 --- /dev/null +++ b/hphp/test/zend/bad/ext-pgsql/pg_update_001.php @@ -0,0 +1,31 @@ + 1, 'id2' => 1)); +pg_insert($conn, 'phptests.foo', array('id' => 1, 'id2' => 2)); + +pg_update($conn, 'foo', array('id' => 10), array('id' => 1)); +var_dump(pg_update($conn, 'foo', array('id' => 10), array('id' => 1), PGSQL_DML_STRING)); + +pg_update($conn, 'phptests.foo', array('id' => 100), array('id2' => 2)); +var_dump(pg_update($conn, 'phptests.foo', array('id' => 100), array('id2' => 2), PGSQL_DML_STRING)); + +$rs = pg_query('SELECT * FROM foo UNION SELECT * FROM phptests.foo'); +while ($row = pg_fetch_assoc($rs)) { + var_dump($row); +} + +pg_query('DROP TABLE foo'); +pg_query('DROP TABLE phptests.foo'); +pg_query('DROP SCHEMA phptests'); + +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-pgsql/pg_update_001.php.expectf b/hphp/test/zend/bad/ext-pgsql/pg_update_001.php.expectf new file mode 100644 index 000000000..a6c1fc659 --- /dev/null +++ b/hphp/test/zend/bad/ext-pgsql/pg_update_001.php.expectf @@ -0,0 +1,14 @@ +string(32) "UPDATE foo SET id=10 WHERE id=1;" +string(43) "UPDATE phptests.foo SET id=100 WHERE id2=2;" +array(2) { + ["id"]=> + string(2) "10" + ["id2"]=> + string(1) "1" +} +array(2) { + ["id"]=> + string(3) "100" + ["id2"]=> + string(1) "2" +} \ No newline at end of file diff --git a/hphp/tools/import_zend_test.py b/hphp/tools/import_zend_test.py index dabb99c78..5f1d61efe 100755 --- a/hphp/tools/import_zend_test.py +++ b/hphp/tools/import_zend_test.py @@ -68,7 +68,6 @@ no_import = ( '/ext/mysql', '/ext/pdo_mysql', '/ext/pdo_sqlite', - '/ext/pgsql', '/ext/spl', '/ext/sqlite3', '/ext/standard',