Naive metadata extraction code in isql is defeated by "check" keyword typed in mixed case [CORE2741] #3136
Labels
affect-version: 1.5.4
affect-version: 1.5.5
affect-version: 1.5.6
affect-version: 2.0.0
affect-version: 2.0.1
affect-version: 2.0.2
affect-version: 2.0.3
affect-version: 2.0.4
affect-version: 2.0.5
affect-version: 2.1.0
affect-version: 2.1.1
affect-version: 2.1.2
affect-version: 2.1.3
affect-version: 2.5 Alpha 1
affect-version: 2.5 Beta 1
affect-version: 2.5 Beta 2
affect-version: 3.0 Initial
component: isql
fix-version: 2.0.6
fix-version: 2.1.4
fix-version: 2.5 RC2
fix-version: 3.0 Alpha 1
priority: major
qa: done successfully
type: bug
Submitted by: Claudio Valderrama C. (robocop)
Assigned to: Claudio Valderrama C. (robocop)
Notice how we type "check" in this example:
F:\fb3dev\fbbuild\firebird30\temp\Win32\Debug\firebird\bin>isql
Use CONNECT or CREATE DATABASE to specify a database
SQL> create database 'surprise.fdb';
SQL> create domain d int chEck (value > 0);
SQL> ^Z
Now, let's extract metadata:
F:\fb3dev\fbbuild\firebird30\temp\Win32\Debug\firebird\bin>isql -x SURPRISE.FDB
Database: SURPRISE.FDB
SET SQL DIALECT 3;
/* CREATE DATABASE 'SURPRISE.FDB' PAGE_SIZE 4096 DEFAULT CHARACTER SET NONE */
/* Domain definitions */
CREATE DOMAIN D AS INTEGER
( chEck (value > 0));
If you submit this script to the server, the extra pair of parentheses is rejected in the syntax. This extra pair comes from isql assuming that the constraint is a non-SQL one (from very old times before IB4) that needs such artifact and in turn, isql naively expects that the user types "check" or "CHECK", but not mixed case.
Commits: 402ccbd 58becc1 f83c4e0 6661495
The text was updated successfully, but these errors were encountered: