Closed (fixed)
Project:
Drupal core
Version:
6.x-dev
Component:
database system
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
5 Dec 2007 at 23:39 UTC
Updated:
6 Jan 2008 at 13:31 UTC
Jump to comment: Most recent file
The db_type_map() function for mysql declares that the Schema API type 'numeric' maps to the mysql type 'numeric'. This works fine, but mysql treats 'numeric' as an alias for its native type 'decimal'. Thus, if you create a column with a Schema API type of 'numeric', when schema.module inspects the database, mysql says the column is of type 'decimal', and schema.module reports an error where none exists.
I can work around this in schema.module but the right solution is to use the correct native type name in core. Trivial patch attached.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | mysql-numeric-type-198234-3.patch | 1.27 KB | bjaspan |
| mysql-numeric-type.patch | 664 bytes | bjaspan |
Comments
Comment #1
bjaspan commentedI left out a step in my explanation.
When schema.module inspects the database and learns that table foo column bar is of type 'decimal', it looks through the results of db_type_map() for which Schema API data type maps to the mysql type 'decimal'. It doesn't find one (because currently the type map lists 'numeric'), and reports an error.
Comment #2
hass commentedsubscribe :-)
Comment #3
bjaspan commentedExactly the same problem exists with pgsql's Schema type char:normal. It maps to 'char' but should map to 'character'. Again, worked around in schema.module but should be fixed in core.
New patch attached.
Comment #4
hass commented@bjaspan: isn't this not critical for the final release?
Comment #5
chx commentedTrivial indeed.
Comment #6
gábor hojtsyThanks, committed.
Comment #7
(not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.