Problem/Motivation

During testing of #1171866: Enforced fetching of fields/columns in lowercase breaks third-party integration, I found a handful of fails in tests using the SQLite and PostgreSQL drivers. I verified that MySQL was fine on the same tests. I was only running the database and field API test groups, and haven't been able to get a full test run to complete yet so there may be other fails that I don't know about.

SQLite

Table test_task created successfully.	Other	database_test.test	63	DatabaseTestCase->installTables()	
***FAIL The whole transaction is rolled back when a duplicate key insert occurs.	Other	database_test.test	3185	DatabaseInvalidDataTestCase->testInsertDuplicateData()	***</strong>
Table test_task created successfully.	Other	database_test.test	63	DatabaseTestCase->installTables()	
***PDOException: SQLSTATE[HY000]: General error: 1 a GROUP BY clause is required before HAVING: SELECT COUNT(*) AS expression FROM (SELECT test.age AS age, age + 1 AS expression, 1 AS expression_2 FROM {test} test HAVING (age + 1 > 0) ) subquery; Array ( ) in PagerDefault->execute() (line 77 of /Users/alan/Sites/d8/core/includes/pager.inc).	Uncaught exception	Connection.php	243	PDO->prepare()	***
Enabled modules: database_test	Other	database_test.test	34	DatabaseTestCase->setUp()	
Enabled modules: field_sql_storage, field, field_test, text, number	Other	field_sql_storage.test	26	FieldSqlStorageTestCase->setUp()	
***FAIL Update succeeded.	Other	field_sql_storage.test	323	FieldSqlStorageTestCase->testFieldUpdateFailure()	***
Table field_data_test_text exists.	Other	field_sql_storage.test	331	FieldSqlStorageTestCase->testFieldUpdateFailure()	

PostgreSQL

Table test_task created successfully.	Other	database_test.test	63	DatabaseTestCase->installTables()	
***PDOException: SQLSTATE[42803]: Grouping error: 7 ERROR: column "test.age" must appear in the GROUP BY clause or be used in an aggregate function LINE 3: (SELECT test.age AS age, age + 1 AS expression, 1 AS express... ^: SELECT COUNT(*) AS expression FROM (SELECT test.age AS age, age + 1 AS expression, 1 AS expression_2 FROM {test} test HAVING (age + 1 > 0) ) subquery; Array ( ) in PagerDefault->execute() (line 77 of /Users/alan/Sites/d8/core/includes/pager.inc).	Uncaught exception	Statement.php	58	PDOStatement->execute()	***
Enabled modules: database_test	Other	database_test.test	34	DatabaseTestCase->setUp()	
Table test created successfully.	Other	database_test.test	63	DatabaseTestCase->installTables()	
Table test_task created successfully.	Other	database_test.test	63	DatabaseTestCase->installTables()	
***FAIL Number of affected rows are returned.	Other	database_test.test	818	DatabaseUpdateTestCase->testExpressionUpdate()	***

D7 has the same fails within these test groups, except that it does not have the transaction fail on SQLite.

Proposed resolution

Remaining tasks

User interface changes

None known

API changes

None known

Comments

c960657’s picture

The GROUP BY tests were fixed in #1491542: testHavingCountQuery() fails on pgsql and sqlite.

A fix for the “The whole transaction is rolled back” error is included in the patch for #1376778: Consistent 'duplicate key' detection in core.

The “Number of affected rows are returned” error is a tricky problem. This is being discussed in #805858: Affected rows inconsistent across database engines.

That leaves only the FieldSqlStorageTestCase->testFieldUpdateFailure() error on Sqlite.

bzrudi71’s picture

Status: Active » Closed (fixed)

No more an issue as we have 100% pass for PostgreSQL and SQLite now :)