Skip to content

Commit 1d78c4c

Browse files
committed
changes from reviews
1 parent c635527 commit 1d78c4c

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

ext/pgsql/pgsql.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4553,7 +4553,7 @@ PHP_PGSQL_API zend_result php_pgsql_convert(PGconn *pg_link, const zend_string *
45534553
ZVAL_STRINGL(&new_val, "'f'", sizeof("'f'")-1);
45544554
}
45554555
else {
4556-
zend_value_error("Detected invalid value (%s) for PostgreSQL '%s' field (%s)", Z_STRVAL_P(val), Z_STRVAL_P(type), ZSTR_VAL(field));
4556+
zend_value_error("Expects valid boolean value for PostgreSQL '%s' field (%s), got `%s`", Z_STRVAL_P(type), ZSTR_VAL(field), Z_STRVAL_P(val));
45574557
err = 1;
45584558
}
45594559
}
@@ -4819,7 +4819,7 @@ PHP_PGSQL_API zend_result php_pgsql_convert(PGconn *pg_link, const zend_string *
48194819
}
48204820
PGSQL_CONV_CHECK_IGNORE();
48214821
if (err) {
4822-
zend_type_error("Expects IPv4, IPv6 or null for PostgreSQL '%s' (%s)", Z_STRVAL_P(type), ZSTR_VAL(field));
4822+
zend_value_error("Expects IPv4, IPv6 or null for PostgreSQL '%s' (%s)", Z_STRVAL_P(type), ZSTR_VAL(field));
48234823
}
48244824
break;
48254825

ext/pgsql/tests/bug71998.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ foreach ($ips as $ip) {
6060
$r = true;
6161
try {
6262
@pg_insert($db, 'tmp_statistics', $data);
63-
} catch (\TypeError $e) {
63+
} catch (\ValueError $e) {
6464
$r = false;
6565
}
6666

ext/pgsql/tests/bug77047.phpt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,19 @@ pg_query($db, "CREATE TABLE bug77047 (
2020
)");
2121

2222
try {
23-
pg_insert($db, "bug77047", array("t" => "13:31"));
24-
pg_insert($db, "bug77047", array("t" => "13:31:13"));
25-
pg_insert($db, "bug77047", array("t" => "1:2:3"));
26-
pg_insert($db, "bug77047", array("t" => "xyz"));
27-
pg_insert($db, "bug77047", array("t" => NULL));
28-
pg_insert($db, "bug77047", array("t" => ""));
23+
pg_insert($db, "bug77047", array("t" => "13:31"));
24+
pg_insert($db, "bug77047", array("t" => "13:31:13"));
25+
pg_insert($db, "bug77047", array("t" => "1:2:3"));
26+
pg_insert($db, "bug77047", array("t" => "xyz"));
27+
pg_insert($db, "bug77047", array("t" => NULL));
28+
pg_insert($db, "bug77047", array("t" => ""));
2929
} catch (\TypeError $e) {
3030
echo $e->getMessage();
3131
}
3232

3333
$res = pg_query($db, "SELECT t FROM bug77047");
3434
while (false !== ($row = pg_fetch_row($res))) {
35-
var_dump(array_pop($row));
35+
var_dump(array_pop($row));
3636
}
3737

3838
?>

0 commit comments

Comments
 (0)