Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Lines 237, 257 and 284 of schema.test attempt to create fields that are not-null and have no default value. I can investigate tomorrow if no one beats me.
This is causing a fail in SQLite and I think it is also causing one in Postgres, not sure.
Comment | File | Size | Author |
---|---|---|---|
#8 | 1004068-sqlite-addtable.patch | 6.2 KB | Damien Tournoud |
#7 | 1004068-sqlite-addtable.patch | 6.2 KB | Damien Tournoud |
#5 | 1004068-sqlite-addtable.patch | 6.29 KB | Damien Tournoud |
#2 | foo.patch | 1.66 KB | dmitrig01 |
#1 | foo.patch | 1.82 KB | dmitrig01 |
Comments
Comment #1
dmitrig01 CreditAttribution: 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 CreditAttribution: 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 CreditAttribution: dmitrig01 commentedbtw, the only difference between #2 and #1 is one line comment change
Comment #4
dmitrig01 CreditAttribution: dmitrig01 commentedAlso to note, most of this code was copy+pasted from mysql driver.
Comment #5
Damien Tournoud CreditAttribution: 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 CreditAttribution: 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 CreditAttribution: 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 CreditAttribution: Damien Tournoud commentedAnd fixed a small typo in changeField().
Comment #9
chx CreditAttribution: chx commentedhttp://drupal.org/node/850852#comment-3859588 we have 100% SQLite!
Comment #10
webchickAwesome!!
Committed to HEAD. :D