Answer the question
In order to leave comments, you need to log in
Why doesn't Firebird throw an exception?
Good afternoon!
I execute the following sequence of requests to Firebird, everything is fine, although, IMHO, an error should be generated.
ALTER TABLE "TestTable" ADD "TestStringColumn" VARCHAR(7) CHARACTER SET UNICODE_FSS<br/>
<br/>
INSERT INTO "TestTable" ("ID","TestStringColumn") VALUES ('6','1234567890')<br/>
Answer the question
In order to leave comments, you need to log in
1. Try to enter 22 digits;
2. Try to enter 21 digits;
3. Try to enter Habrahabr;
4. Try to enter Habrakh;
5. Read this: www.ibase.ru/devinfo/ib_unicode.htm .
Thanks for the good question, I didn't know that before :)!
MySQL doesn't always throw an error either.
Example:
CREATE TABLE `test` (
`id` INT NOT NULL,
`name` VARCHAR( 7 ) NOT NULL,
PRIMARY KEY ( `id` )
) ENGINE = MYISAM;
Query:
INSERT INTO test (id, name) VALUES ('6','1234567890');
There is such a parameter as sql_mode, which is responsible for compatibility.
If it is set to STRICT_TRANS_TABLES, then you will get an error:
#1406 - Data too long for column 'name' at row 1
And if it is empty or ANSI, then the query will be successfully completed and the data will simply be silently truncated.
I suspect that there is a similar parameter in Firebird.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question