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

changing domain from String to Int causes data conversion error when performing select on that table [CORE3267] #3635

Closed
firebird-automations opened this issue Nov 30, 2010 · 6 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: Jonas Jasas (jon)

If table has a field which domain is String (20), and that table has a row which data for that field is i.e. 'z300', and we change domain of that field to type "Integer" - then performing Select on that table causes conversion error.

@firebird-automations
Copy link
Collaborator Author

Commented by: @asfernandes

How did you change the field type?

@firebird-automations
Copy link
Collaborator Author

Commented by: Jonas Jasas (jon)

Using IBExpert. I doubleclicked on the field name in the table fields list and then selected domain from drop-down list.

update RDB$RELATION_FIELDS set
RDB$FIELD_SOURCE = 'TREGNR',
RDB$COLLATION_ID = -1
where (RDB$FIELD_NAME = 'TEST') and
(RDB$RELATION_NAME = 'SUTARCIUANTR')

Changed from: CREATE DOMAIN TKODAS AS VARCHAR(20) CHARACTER SET ISO8859_13 COLLATE LT_LT;
Changed to: CREATE DOMAIN TREGNR AS INTEGER;

@firebird-automations
Copy link
Collaborator Author

Commented by: @dyemanov

Then forward your issue to the IBExpert developers. Direct manipulations with system tables should be done with a lot of care, it's undocumented and potentially dangerous feature. The officially supported ALTER statement doesn't allow conversions from strings to integers, as it's guaranteed to provide you with problems like the described one.

@firebird-automations
Copy link
Collaborator Author

Commented by: Sean Leyne (seanleyne)

As Dmitry has pointed out, direct manipulations of system tables is not officially supported by the project.

@firebird-automations
Copy link
Collaborator Author

Modified by: Sean Leyne (seanleyne)

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Won't Fix [ 2 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

status: Resolved [ 5 ] => Closed [ 6 ]

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