Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

embed spaces and CR+LF before DEFAULT [CORE356] #696

Closed
firebird-automations opened this issue Feb 4, 2002 · 3 comments
Closed

embed spaces and CR+LF before DEFAULT [CORE356] #696

firebird-automations opened this issue Feb 4, 2002 · 3 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: mmenaz (mmenaz)

Assigned to: Claudio Valderrama C. (robocop)

SFID: 512975#⁠
Submitted By: mmenaz

Firebird RC2, IB 6.0.1

When creating tables with columns that
are of a certain domain, you can "embed"
spaces or CR+LF into the
definition between the domain name and the
default
keyword.

output:
Without domains
(correct):
DEF_ERROR_NODOM.INTERESSI DEFAULT
0
DEF_ERROR_NODOM.STAMPATO_MODULO DEFAULT 'S'

With
domains (wrong):
DEF_ERROR.INTERESSI
DEFAULT
0
DEF_ERROR.STAMPATO_MODULO DEFAULT 'S'

Note that the
DEF_ERROR.INTERESSI column has the DEFAULT keyword on a new
line
(! If read back, there is a Cr+Lf), and that
DEF_ERROR.STAMPATO_MODULO has 4
spaces before the
DEFAULT.
This provokes some problems in tools, like IBObject,
that relies upon a well
formed string.
I've found no mention of
this in the Firebird sourgeforce bug database, but I
don't
understand if it's only for open, recent bugs or not (I posted a
similar
problem with ALTER DOMAIN, but it's fixed in Firebird
RC2, while this is not).
Is it a issue to submit?

Here the
details:
CREATE TABLE DEF_ERROR (
RITENUTAMOV_ID AUTOINC_DM
NOT NULL,
RITENUTA MONEY_DM,
INTERESSI MONEY_DM
DEFAULT
0,
STAMPATO_MODULO NOSI_DM DEFAULT 'S',
TESORERIA_CAPITOLO
RIT_TESORERIA_CAPITOLO_DM);

CREATE TABLE
DEF_ERROR_NODOM (
RITENUTAMOV_ID INTEGER NOT NULL,
RITENUTA
NUMERIC(15,2),
INTERESSI NUMERIC(15,2)
DEFAULT
0,
STAMPATO_MODULO CHAR(1) DEFAULT 'S',
TESORERIA_CAPITOLO
CHAR(1));

/* ***************** domains
********************** */
CREATE DOMAIN AUTOINC_DM
AS
NUMERIC(18,0)

CREATE DOMAIN MONEY_DM
AS
NUMERIC(15,2)
DEFAULT 0
CHECK (ALUE BETWEEN -
9999999999999.99 AND +9999999999999.99)

CREATE DOMAIN
NOSI_DM AS
CHAR(1)
DEFAULT 'N'
NOT NULL
CHECK (VALUE IN
('S', 'N'))

CREATE DOMAIN RIT_TESORERIA_CAPITOLO_DM
AS
VARCHAR(6)
CHECK ((VALUE IS NULL) OR (VALUE =
UPPER(VALUE)))

/* **************** default query
***************** */
SELECT RTRIM(RDB$RELATION_NAME) || ' .'
|| RTRIM(RDB$FIELD_NAME),
RDB$DEFAULT_SOURCE
FROM
RDB$RELATION_FIELDS
WHERE RDB$DEFAULT_SOURCE IS NOT
NULL

Thanks
Marco Menardi

@firebird-automations
Copy link
Collaborator Author

Commented by: Alice F. Bird (firebirds)

Date: 2005-01-17 10:12
Sender: robocop
Logged In: YES
user_id=62823

Spaces or newlines before DEFAULT will be deleted.
Spaces or newlines between DEFAULT and whatever value that
was stored will be converted for now into spaces.

Nickolay reported this worse anomaly:
Alexander Khvastunov (IBExpert author) was complaining about
the problem for long time already.

SQL> CREATE DOMAIN DOM_ID INTEGER NOT NULL;
SQL> CREATE TABLE A (
CON> ID DOM_ID /* INTEGER NOT NULL */ DEFAULT 0 );
SQL> commit;
SQL> select rdb$default_source from rdb$relation_fields
where rdb$field_name = 'ID' and rdb$relation_name = 'A';

RDB$DEFAULT_SOURCE

        5:696

==============================================================================
RDB$DEFAULT_SOURCE:
/* INTEGER NOT NULL */ DEFAULT 0

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

Workflow: jira [ 10380 ] => Firebird [ 14640 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

QA Status: No test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant