Merge branch 'PHP-5.5' into PHP-5.6

* PHP-5.5:
  NEWS 5.5
  Fixed Bug #69667 segfault in php_pgsql_meta_data
  fix test output (32bits)
This commit is contained in:
Remi Collet 2015-05-20 08:11:24 +02:00
commit e41a2009d6
2 changed files with 34 additions and 2 deletions

View File

@ -0,0 +1,27 @@
--TEST--
PostgreSQL pg_select() - basic test using schema
--SKIPIF--
<?php include("skipif.inc"); ?>
--FILE--
<?php
include('config.inc');
$conn = pg_connect($conn_str);
foreach (array('', '.', '..') as $table) {
var_dump(pg_insert($conn, '', array('id' => 1, 'id2' => 1)));
}
?>
Done
--EXPECTF--
Warning: pg_insert(): The table name must be specified in %s on line %d
bool(false)
Warning: pg_insert(): The table name must be specified in %s on line %d
bool(false)
Warning: pg_insert(): The table name must be specified in %s on line %d
bool(false)
Done

View File

@ -5479,7 +5479,11 @@ PHP_PGSQL_API int php_pgsql_meta_data(PGconn *pg_link, const char *table_name, z
src = estrdup(table_name);
tmp_name = php_strtok_r(src, ".", &tmp_name2);
if (!tmp_name) {
efree(src);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "The table name must be specified");
return FAILURE;
}
if (!tmp_name2 || !*tmp_name2) {
/* Default schema */
tmp_name2 = tmp_name;
@ -6496,7 +6500,8 @@ static int do_exec(smart_str *querystr, int expect, PGconn *pg_link, ulong opt T
static inline void build_tablename(smart_str *querystr, PGconn *pg_link, const char *table)
{
char *table_copy, *escaped, *token, *tmp;
char *table_copy, *escaped, *tmp;
const char *token;
size_t len;
/* schame.table should be "schame"."table" */