update system.install as SQL friendly
hswong3i - August 7, 2007 - 07:04
| Project: | Drupal |
| Version: | 6.x-dev |
| Component: | database system |
| Category: | bug report |
| Priority: | critical |
| Assigned: | hswong3i |
| Status: | closed |
Description
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.
| Attachment | Size | Status | Test result | Operations |
|---|---|---|---|---|
| drupal-6.x-dev-system.install-0.1.diff | 1 KB | Ignored | None | None |

#1
Well, 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!
#2
non 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.
#3
Ah, thanks for the info Moshe, we agree that 'delta' is misleading.
#4
update system.install into regular format. P.S. we need to use db_query() correctly for cross database concern :)
#5
since 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.
#6
This 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.
#7
Oops, that was for another patch that did pretty much the same thing :)
#8
OK, committed.
#9