Skip to content

Commit

Permalink
Use queryRow instead of db_query when creating tables and indexes so …
Browse files Browse the repository at this point in the history
…query can be logged.

git-svn-id: http://voip.null.ro/svn/ansql/trunk@268 dbfed7de-b0aa-0410-b6a1-c7e608b77fc9
  • Loading branch information
monica committed Oct 31, 2016
1 parent 7f14fdb commit e8cb6b8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions framework.php
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ private static function query_result($query, $res, $retrieve_last_id)
case "postgresql":
$oid = pg_last_oid($res);
$query2 = "SELECT ".$retrieve_last_id[0]." FROM ".$retrieve_last_id[1]." WHERE oid=$oid";
$res2 = self::db_query($query2);
$res2 = self::queryRaw($query2);
if (!$res2)
return false;
$last_id = pg_fetch_result($res2,0,0);
Expand Down Expand Up @@ -596,7 +596,7 @@ public static function createTable($table,$vars)
$query.= "ENGINE $engine";
}

$res = self::db_query($query) !== false;
$res = self::queryRaw($query) !== false;
if (!$res)
Debug::Output(_("Could not create table")." '$table'. "._("Query failed").": $query". " .Error: ".Database::get_last_db_error());

Expand Down Expand Up @@ -809,7 +809,7 @@ public static function createIndex($table, $columns)
$query = "CREATE INDEX ".esc($index_name)." ON ".esc($table)." USING btree ($index_columns)";
break;
}
$res = self::db_query($query);
$res = self::queryRaw($query);
if (!$res)
{
$no_error = false;
Expand Down

0 comments on commit e8cb6b8

Please sign in to comment.