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

"conversion error from string" after change of field type from BIGINT to VARCHAR(21) [CORE3045] #3426

Closed
firebird-automations opened this issue Jun 15, 2010 · 8 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: Simeon Bodurov (simeon.bodurov)

Is related to CORE1432
Is related to QA441

I had altered type of filed in our database from BIGINT to VARCHAR(21). After alter table I was unable to do selects from this table if select clause contained string value in equals expression over this field. After backup and restore the selects worked. But this was not an option for our database upgrade script. So we were forced to create new VARCHAR field, copy values from BIGINT to VARCHAR field, drop BIGINT filed and rename the second field to original name.

I have created script that simulates the problem.

test script:

SET SQL DIALECT 3;

CREATE DATABASE 'localhost:C:\test.fdb' USER 'SYSDBA' PASSWORD 'masterkey';

COMMIT;

CONNECT 'localhost:C:\test.fdb' USER 'SYSDBA' PASSWORD 'masterkey';

CREATE TABLE TEST1(
ID INTEGER,
TEST_FIELD BIGINT,

PRIMARY KEY(ID)
);

COMMIT;

INSERT INTO TEST1(ID, TEST_FIELD)
VALUES(1, 234);

COMMIT;

ALTER TABLE TEST1
ALTER TEST_FIELD TYPE VARCHAR(21);

COMMIT;

SELECT ID, TEST_FIELD
FROM TEST1
WHERE TEST_FIELD = 'A';

expected result:
empty result set

actual result:
ID TEST_FIELD
============ =====================
Statement failed, SQLCODE = -413
conversion error from string "A"
After line 26 in file test.sql

@firebird-automations
Copy link
Collaborator Author

Commented by: @AlexPeshkoff

Please try - is it still a case with 2.5 snapshot builds.

@firebird-automations
Copy link
Collaborator Author

Commented by: Simeon Bodurov (simeon.bodurov)

I have tested it with Firebird 2.5.0.26038. Good news - it works. So this is not an issue for Firebird 2.5

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

Link: This issue is related to CORE1432 [ CORE1432 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

assignee: Adriano dos Santos Fernandes [ asfernandes ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

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

resolution: Fixed [ 1 ]

Fix Version: 2.5.0 [ 10221 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

Link: This issue is related to QA441 [ QA441 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pmakowski

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

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

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

QA Status: Done successfully

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

2 participants