This removes the required username from installer (a followup patch, I presume, could add a validator for other DB), fixes up aggregator test and DrupalErrorHandlerUnitTest.

CommentFileSizeAuthor
#11 333095-demeow.patch2.02 KBDamien Tournoud
demeowsqlite.patch1.62 KBchx
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

webchick’s picture

Title: Demeow sqlite patch » UNSTABLE-3 blocker: Demeow sqlite patch

Tagging for perusal later.

Damien Tournoud’s picture

Title: UNSTABLE-3 blocker: Demeow sqlite patch » Demeow sqlite patch

The merge fix is already in #332002: MergeQuery should refuse to execute if there are no key fields. But that issue is on the verge of derailing.

Damien Tournoud’s picture

Title: Demeow sqlite patch » UNSTABLE-3 blocker: Demeow sqlite patch
Damien Tournoud’s picture

Title: UNSTABLE-3 blocker: Demeow sqlite patch » Demeow sqlite patch

Ok, tested the affected part. Good to go.

Damien Tournoud’s picture

Title: Demeow sqlite patch » UNSTABLE-3 blocker: Demeow sqlite patch

And again... :)

webchick’s picture

Could someone explain this hunk?

-    $this->assertErrorMessage('PDOException', 'system_test.module', 'system_test_trigger_pdo_exception()', 'Base table or view not found');
+    $this->assertErrorMessage('PDOException', 'system_test.module', 'system_test_trigger_pdo_exception()', 'SQLSTATE');

Looks like that's meant to be a constant? or..?

webchick’s picture

Status: Reviewed & tested by the community » Needs review
lilou’s picture

See this : http://fr2.php.net/manual/en/pdo.errorcode.php

Briefly, an SQLSTATE consists of a two-character class value followed by a three-character subclass value.

and also : http://developer.mimer.com/documentation/html_92/Mimer_SQL_Engine_DocSet...

webchick’s picture

Ok cool. But it's wrapped in single quotes. Bug?

chx’s picture

PDO returns a message in the form 'SQLSTATE[42S02]: Base table or view not found', but neither the error code nor the error message are standardised across database engines. Not bug.

Damien Tournoud’s picture

FileSize
2.02 KB

Added a code comment about that.

webchick’s picture

Title: UNSTABLE-3 blocker: Demeow sqlite patch » Demeow sqlite patch

While this is a blocker for SQLite, it's not a blocker for UNSTABLE-3. Adjusting title accordingly.

webchick’s picture

Status: Needs review » Reviewed & tested by the community

To clarify, this patch changes three things:

1) It removes the required bit from the username field in the database settings, since some database systems (such as SQLite) do not require it.
2) It fixes an incorrect merge query in aggregator module. This doesn't fire errors in MySQL because MySQL's merge implementation that relies on the internal mysql collisions and not the keys.
3) It genericizes an error check in one of the tests so that it works across database systems.

What befuddled me above was I wasn't counting arguments so thought 'SQLSTATE' was the message displayed when the assertion was triggered, not the error message to check for. It's kinda crappy that we can't get any more fine-grained than "SQLSTATE" because that'll likely be triggered for almost any error. However, Damien and chx told me that even the specific error number varies from platform to platform, so this is the best we can do for now. :\

Tonight I'm working on UNSTABLE-3 but can commit this tomorrow.

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Ok, committed!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.