Bugs and Features item #3562915, was opened at 2012-08-29 10:19
Message generated for change (Comment added) made by jakubvrana
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=1127745&aid=3562915&group_id=264133
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: SQLite
Group: 3.5.1
>Status: Closed
>Resolution: Invalid
Priority: 5
Private: No
Submitted By: gmtfn (gmtfn)
Assigned to: Jakub Vrána (jakubvrana)
Summary: String is used to specify default value for integer column
Initial Comment:
I am not sure if this is really a problem, but definitely seems like a source for confusion.
Consider attemptNum integer NULL [0] as definition for a column. This column was added to the DB by Adminer. When I look at the DB using SQLite Expert, it shows the default value for this column as '0' -- a string, not a number. And the DDL for the table is listed as follows (only the relevant part):
"attemptNum" integer NULL DEFAULT '0'
As I said, this doesn't *seem* to create a problem, but this has caused a concern on my part. Others might worry too when they see something similar.
Would it be possible to enter integers for default values when data type specified is integer? (Or float for float.)
----------------------------------------------------------------------
>Comment By: Jakub Vrána (jakubvrana)
Date: 2012-09-09 16:45
Message:
MySQL doesn't allow storing strings as default values for integer columns
and it allows passing numeric values enclosed in single quotes. Command
"ALTER TABLE `t` MODIFY `i` int(11) NOT NULL DEFAULT 0" results in the
following line in "SHOW CREATE TABLE":
`i` int(11) NOT NULL DEFAULT '0'
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=1127745&aid=3562915&group_id=264133
|