Mantis - Quercus
Viewing Issue Advanced Details
4752 minor always 09-08-11 03:59 06-21-12 00:30
petja  
nam  
normal  
closed  
fixed  
none    
none  
0004752: Incorrect response from longtext column in Google SQL Service environment
In Google App Engine environment with SQL service on. Quercus returns incorrect value from lontext columns to php program. Attached is a simple test case with sql for database and php file for testing.

Result for the test case in localhost environment: test_value :testing long text field

Result for the test case in Google App engine environment: result :com.google.cloud.sql.jdbc.internal.ClientSideBlob@e316ed3a
You can use SQL Service as database provider by adding following code to QuercusServlet:

try {
  AppEngineDriver driver = new AppEngineDriver();
  DriverManager.registerDriver(driver);
  GoogleDataSource dataSource = new GoogleDataSource(driver) {};
  dataSource.setInstance("mycorp:instance");
  setDatabase(dataSource);
} catch (SQLException e) {
  throw new ExceptionInInitializerError(e);
}
 test.zip [^] (549 bytes) 09-08-11 03:59
 test.tar.gz [^] (394 bytes) 09-20-11 22:16

Notes
(0005521)
petja   
09-20-11 22:19   
Zip and gzip seems to get corrupted for some reason, so here's those files in text.

test.php
<?php
$connect_link = mysql_connect('localhost', 'username', 'password');
$db_link = mysql_select_db('testDb');
$result = mysql_query("SELECT test FROM test");
$db_array = mysql_fetch_object($result);
echo 'result :' . $db_array->test . '
';
?>

test schema and table:

CREATE TABLE `test` (
  `test` longtext
);
INSERT INTO `test` VALUES ('testing long text field');
(0005549)
petja   
10-06-11 22:26   
Fixed in new version of Google SQL Service.
(0005903)
nam   
06-21-12 00:30   
Fixed in 4.0.29. Quercus should now correctly handle all types of blobs returned by Cloud SQL.