← Back to team overview

anewt-developers team mailing list archive

[Branch ~uws/anewt/anewt.uws] Rev 1796: [database] Unconditionally obtain field types in result sets

 

------------------------------------------------------------
revno: 1796
committer: Wouter Bolsterlee <uws@xxxxxxxxx>
branch nick: anewt
timestamp: Tue 2010-10-05 23:15:21 +0200
message:
  [database] Unconditionally obtain field types in result sets
  
  Don't use heuristics on the SQL string to decide whether to
  obtain field types for result sets. This fixes wrong type
  casting for the result of queries like '(SELECT ...) UNION
  (SELECT ...)' (with the parentheses) that failed the string
  test.
modified:
  database/result-set.lib.php


--
lp:anewt
https://code.launchpad.net/~uws/anewt/anewt.uws

Your team Anewt developers is subscribed to branch lp:anewt.
To unsubscribe from this branch go to https://code.launchpad.net/~uws/anewt/anewt.uws/+edit-subscription
=== modified file 'database/result-set.lib.php'
--- database/result-set.lib.php	2009-03-30 21:10:32 +0000
+++ database/result-set.lib.php	2010-10-05 21:15:21 +0000
@@ -71,10 +71,7 @@
 		$this->sql = $sql;
 		$this->connection_handle = $connection_handle;
 		$this->result_set_handle = $result_set_handle;
-
-		/* Deduce column types for SELECT queries */
-		if (AnewtDatabaseSQLTemplate::query_type_for_sql($sql) == ANEWT_DATABASE_SQL_QUERY_TYPE_SELECT)
-			$this->obtain_field_types();
+		$this->obtain_field_types();
 	}
 
 	/**