List:Commits« Previous MessageNext Message »
From:uwendel Date:October 22 2007 1:29pm
Subject:PHP mysqlnd svn commit: r1125 - trunk/tests/ext/pdo_mysql
View as plain text  
Author: uwendel
Date: 2007-10-22 15:29:19 +0200 (Mon, 22 Oct 2007)
New Revision: 1125

Modified:
   trunk/tests/ext/pdo_mysql/mysql_pdo_test.inc
Log:
Changing the code to reflect the stinky PDO_MYSQL behaviour.


Modified: trunk/tests/ext/pdo_mysql/mysql_pdo_test.inc
===================================================================
--- trunk/tests/ext/pdo_mysql/mysql_pdo_test.inc	2007-10-22 13:18:41 UTC (rev 1124)
+++ trunk/tests/ext/pdo_mysql/mysql_pdo_test.inc	2007-10-22 13:29:19 UTC (rev 1125)
@@ -85,6 +85,24 @@
 	}
 
 	static function extractVersion($version_string) {
+		/*
+		TODO:
+		We're a bit in trouble: PDO_MYSQL returns version strings.
+		That's wrong according to the manual. According to the manual
+		integers should be returned. However, this code needs to work
+		with stinky PDO_MYSQL and hopefully better PDO_MYSQLND.
+		*/
+
+		// already an int value?
+		if (is_int($version_string))
+			return $version_string;
+
+		// string but int value?
+		$tmp = (int)$version_string;
+		if (((string)$tmp) === $version_string)
+			return $tmp;
+
+		// stinky string which we need to parse
 		$parts = explode('.', $version_string);
 		if (count($parts) != 3)
 			return -1;

Thread
PHP mysqlnd svn commit: r1125 - trunk/tests/ext/pdo_mysqluwendel22 Oct