Navigation Menu

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

Incorrect default value when adding a new column [CORE4351] #4673

Closed
firebird-automations opened this issue Feb 24, 2014 · 18 comments
Closed

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: Yiannis Bourkelis (yiannis)

Attachments:
Database.fdb

On the existing table PRACTICEIFO which contains one record, I want to add a new field with name: GOOGLE_PASSWORD and default value: 'MdX8fLruCUQ=' using the following query, however when executing the query the default value of the new field is incorrect.

Steps to reproduce:
Execute the following sql statement on the attached database:

ALTER TABLE PRACTICEINFO ADD GOOGLE_PASSWORD VARCHAR(400) CHARACTER SET UTF8 DEFAULT 'MdX8fLruCUQ=' NOT NULL COLLATE UTF8;

Expected results:
The value of GOOGLE_PASSWORD column on existing record shoud be 'MdX8fLruCUQ='

Actual results:
The value of GOOGLE_PASSWORD column on existing records is 'MdX'

====== Test Details ======

Confirmed on WI-V2.1.7.18553: pwd = 'MdX'

@firebird-automations
Copy link
Collaborator Author

Modified by: Yiannis Bourkelis (yiannis)

Attachment: Database.fdb [ 12441 ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @hvlad

a) what is connection character set ?
b) does you tried with isql ?

@firebird-automations
Copy link
Collaborator Author

Commented by: Ann Harrison (awharrison)

Should a newly defined default apply to records that were stored with a null in that field?

@firebird-automations
Copy link
Collaborator Author

Commented by: Yiannis Bourkelis (yiannis)

@vlad: On flamerobin the connection charset is set to NONE. I also tryied UTF8. Both return incorrect results.

I just tryied to run the query using isql and it works correctly.

@ann: I have never tryied that. Whenever I want to change the value of existing NULL columns, I execute an UPDATE statement first and then set the DEFAULT on that field to be sure.

@firebird-automations
Copy link
Collaborator Author

Commented by: @asfernandes

> I just tryied to run the query using isql and it works correctly.

So? It's a problem with Flamerobin?

@firebird-automations
Copy link
Collaborator Author

Commented by: Sean Leyne (seanleyne)

Case is closed, since the issue cannot be reproduced with Firebird tools/components.

@firebird-automations
Copy link
Collaborator Author

Modified by: Sean Leyne (seanleyne)

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

resolution: Cannot Reproduce [ 5 ]

@firebird-automations
Copy link
Collaborator Author

Commented by: Yiannis Bourkelis (yiannis)

I will try to reproduce it with isql. How can I set the connection character set to NONE or UTF8?

@firebird-automations
Copy link
Collaborator Author

Commented by: @asfernandes

isql -ch utf8

@firebird-automations
Copy link
Collaborator Author

Commented by: Yiannis Bourkelis (yiannis)

Thank you Adriano,
I was able to reproduce it with isql:

Steps to reproduce:

1.run isql.exe -ch utf8 <path to attached database> -user SYSDBA -password <your password>

2. SQL> ALTER TABLE PRACTICEINFO ADD GOOGLE_PASSWORD VARCHAR(400) CHARACTER SET UTF8 DEFAULT 'MdX8fLruCUQ=' NOT NULL COLLATE UTF8;

3. exit;

Inspect the value of PRACTICEIFNO.GOOGLE_PASSWORD field. It is 'MdX' and not 'MdX8fLruCUQ='

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

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

@firebird-automations
Copy link
Collaborator Author

Commented by: @asfernandes

Can you also test 2.5? I believe it's fixed there.

@firebird-automations
Copy link
Collaborator Author

Commented by: Sean Leyne (seanleyne)

It seems that it is a real issue, but with older builds. So, re-opening pending review.

@firebird-automations
Copy link
Collaborator Author

Modified by: Sean Leyne (seanleyne)

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

resolution: Cannot Reproduce [ 5 ] =>

@firebird-automations
Copy link
Collaborator Author

Commented by: Yiannis Bourkelis (yiannis)

I tested it on Firebird 2.5.2.26539 and it works as expected.

@firebird-automations
Copy link
Collaborator Author

Modified by: Sean Leyne (seanleyne)

status: Reopened [ 4 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

Fix Version: 2.5.2 [ 10450 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

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

QA Status: Done successfully

Test Details: Confirmed on WI-V2.1.7.18553: pwd = 'MdX'

@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