With this patch, the last remnants of the old database layer have been swept away. Transactions will keep modules in line. Transactions and prepared statements. (End Star Wars quote)

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Status: Needs review » Needs work

The last submitted patch failed testing.

Crell’s picture

Status: Needs work » Needs review

Head was broken for a while. Retesting.

Status: Needs review » Needs work

The last submitted patch failed testing.

bcn’s picture

Status: Needs work » Needs review

I don't think this was tested yet.

Status: Needs review » Needs work

The last submitted patch failed testing.

Berdir’s picture

Oh, nice patch crossposting :(, haven't seen this one

Your patch seems to be missing a few INSERT-query conversions in system_install() and the strange comment_update_1 function.

I think both patches have the same install problem, the error message is "SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'd7_variable' already exists ". Don't have time to work on it today....

sun’s picture

Issue tags: +API clean-up

Tagging.

webchick’s picture

Subscribing! Yum.

Berdir’s picture

Status: Needs work » Needs review
Issue tags: -API clean-up
FileSize
70.83 KB

Here is a new patch...

Fixed some stuff and changed db_query_range() after a discussion in #drupal. Basically, I made $args optional and moved it behind $from and $count. Either that or adding a array() to all db_query_range() calls without params. Patch is now quit a bit bigger now..

I was able to install locally, so, lets see what happens now...

Berdir’s picture

Issue tags: +API clean-up

Did not want to remove the tag...

Status: Needs review » Needs work

The last submitted patch failed testing.

Berdir’s picture

FileSize
72.05 KB

Forgot one call to queryRange, let's try again...

Berdir’s picture

Status: Needs work » Needs review
Berdir’s picture

FileSize
74.56 KB

Some clean-ups...

- All $args are now type hinted and default to an empty array() ("array $args = array()") in both the wrapper and the actual functions.

- Explanation about comment_update_1(): That function is around since D5, contained an non-converted query so I assumed it is ok to just remove it instead of converting and maybe even conflicting with other patches that would remove it in the meantime

- $from and $count are now required params for db_query_range() like queryRange() already was. Previously, they had a default value 0 (probably to help with the func_get_args() magic) but you can't LIMIT 0,0 anyway.

Berdir’s picture

FileSize
74.58 KB

Another cleanup, $options is now type hinted in the db_query* wrapper functions too.

Crell’s picture

Status: Needs review » Reviewed & tested by the community

So long, Farewell, Auf Wiedersehen, Good Bye!

Berdir, thank you so much for all of your hard work getting core fully converted!

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Awesome work folks!!

Perhaps my favourite patch of Drupal 7. :) Committed to HEAD!!

I assume this is covered enough by our DBTNG docs, so marking fixed.

Damien Tournoud’s picture

Status: Fixed » Needs review
FileSize
4.65 KB

db_add_column() and db_change_column() needs to go away too. Those are very old functions that are useless at least since Drupal 6.

sun’s picture

Status: Needs review » Reviewed & tested by the community

Exactly, not used at all.

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Woohoo! Committed to HEAD.

Status: Fixed » Closed (fixed)
Issue tags: -DIE, -API clean-up

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