Closed (fixed)
Project:
Drupal core
Version:
7.x-dev
Component:
sqlite database
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
21 Dec 2010 at 09:22 UTC
Updated:
6 Jan 2011 at 01:50 UTC
Jump to comment: Most recent file
Comments
Comment #1
dmitrig01 commentedFixes that issue (pgsql is different). There is still one fail on sqlite for SchemaTestCase, but it fails with or without the patch (oddly, it fails on my computer but nt on ci.drupal.org)
Comment #2
dmitrig01 commentedThis patch doesn't need tests, as the tests already exist, they fail, and this fixes them. There is another fail in the same test case that's being terribly hard to debug as it only fails my local machine and not ci.drupal.org, and it's very obscure. But unrelated to this patch -- I think there's something wrong with the test.
Comment #3
dmitrig01 commentedbtw, the only difference between #2 and #1 is one line comment change
Comment #4
dmitrig01 commentedAlso to note, most of this code was copy+pasted from mysql driver.
Comment #5
damien tournoud commented#2 made the schema test pass on SQLite, but it is not exactly the proper way to do that.
We can add a field directly to a SQLite table using ALTER TABLE if and only if: it is not a PRIMARY KEY, it is not both NOT NULL and without a default value (more precise constraints are described in http://www.sqlite.org/lang_altertable.html). In all the other cases, we have to fallback to the slower method of creating a new table and migrating the data over.
To simplify, I considered that we use the slower method whenever we have to add indexes or we have a NOT NULL column without a default value. I implemented the rest of the DatabaseSchema::addField() and that passes tests on ci.
Comment #6
dmitrig01 commentedI read over the code, tried it out and ran the test - looks good. I'd RTBC it but I'm ineligible.
Comment #7
damien tournoud commentedA few improvements from chx: we don't need to workaround bugs in addField() and addExpression() anymore, they have been long fixed. Also fixed a comment typo.
Comment #8
damien tournoud commentedAnd fixed a small typo in changeField().
Comment #9
chx commentedhttp://drupal.org/node/850852#comment-3859588 we have 100% SQLite!
Comment #10
webchickAwesome!!
Committed to HEAD. :D