Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
system.install try to insert a integer into VARCHAR without '', which will face error when working with DB2. this patch will change "0" into "'0'" for string escape.
Comment | File | Size | Author |
---|---|---|---|
#4 | drupal-6.x-dev-system.install-0.2.diff | 5.03 KB | hswong3i |
drupal-6.x-dev-system.install-0.1.diff | 1 KB | hswong3i | |
Comments
Comment #1
Gábor HojtsyWell, although it is possible to use any string as a delta, not only numbers, it might make sense to convert this field to an INT later (not in Drupal 6 obviously). AFAIK people don't use the possibility widely to utilize non-numeric delta values.
Anyway, thanks for the patch, committed!
Comment #2
moshe weitzman CreditAttribution: moshe weitzman commentednon numeric delta is becoming more popular. Views for one, uses this. I think a better course of action is to rename delta to $id and encourage use of non numerics. they are more readable, and less easy to accidentally reuse when adding a block where an old one used to live. in any case, this is a good patch. thanks for committing.
Comment #3
Gábor HojtsyAh, thanks for the info Moshe, we agree that 'delta' is misleading.
Comment #4
hswong3i CreditAttribution: hswong3i commentedupdate system.install into regular format. P.S. we need to use db_query() correctly for cross database concern :)
Comment #5
hswong3i CreditAttribution: hswong3i commentedsince both Oracle/DB2/MSSQL will preform A LOT OF reserved word rewrite handling to query BODY, this patch can greatly improve the ability of cross database compatibility. This is because all user input values are escaped, and will not capture by rewrite handling.
Comment #6
dmitrig01 CreditAttribution: dmitrig01 commentedThis is much needed. Dries and Gabor, the reason for this is because MSSQL, Oracle and DB2 run many regular expressions on the queries (and large ones). They can catch most situations, however the parsers aren't perfect. They match SQL keywords and %s/%d/%f/%%/%b. Not just any text.
Comment #7
dmitrig01 CreditAttribution: dmitrig01 commentedOops, that was for another patch that did pretty much the same thing :)
Comment #8
Gábor HojtsyOK, committed.
Comment #9
(not verified) CreditAttribution: commented