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

LOWER() + SUBSTR() do not give correct result (but SUBSTR() + LOWER() does) [CORE4410] #4732

Closed
firebird-automations opened this issue Apr 29, 2014 · 12 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: christophe derenne (cdr60530)

Let's try :
select lower('JoËl') from rdb$database; result : joël : that's ok

Now let's try
select lower('Ë') from rdb$database; result : ë: that's ok

Now let's try
select lower(substr('JoËl',3,3)) from rdb$database; result : Ë : THAT IS WRONG

@firebird-automations
Copy link
Collaborator Author

Commented by: @WarmBooter

The result of lower depends on the charset you are using. What charset you have tried?

@firebird-automations
Copy link
Collaborator Author

Commented by: Sean Leyne (seanleyne)

What is the result if you reverse the order of the operations to SUBSTR, LOWER?

@firebird-automations
Copy link
Collaborator Author

Commented by: christophe derenne (cdr60530)

Hi,

select substr(lower('JoËl'),3,3) from rdb$database; is working but this syntax is not corresponding to what I want to do in my stored procedure.

@firebird-automations
Copy link
Collaborator Author

Commented by: Sean Leyne (seanleyne)

1- This points out that the problem is not with LOWER() but with SUBSTR(), so the case title/subject should be changed.

2- Although this may not be how you SP is coded, changing the sequence of operation at least provides a workaround to the problem.

@firebird-automations
Copy link
Collaborator Author

Commented by: christophe derenne (cdr60530)

At first, the title was about the lower fonction but Sean Leyne ask me to change the title beacause if substr is using after lower, it give the right result, so, substr that has probably a bug inside and not the lower function.

@firebird-automations
Copy link
Collaborator Author

Modified by: christophe derenne (cdr60530)

summary: lower function does not get lowercase in some case => substr function stop lower function to give the correct result

@firebird-automations
Copy link
Collaborator Author

Modified by: Sean Leyne (seanleyne)

summary: substr function stop lower function to give the correct result => LOWER() + SUBSTR() do not give correct result (but SUBSTR() + LOWER() does)

@firebird-automations
Copy link
Collaborator Author

Modified by: @asfernandes

assignee: Adriano dos Santos Fernandes [ asfernandes ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @asfernandes

"substr" is legacy UDF function which should not be used. Use SUBSTRING(x from y to z) which surely will work better with charsets and collations.

@firebird-automations
Copy link
Collaborator Author

Modified by: @asfernandes

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

resolution: Won't Fix [ 2 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

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

@firebird-automations
Copy link
Collaborator Author

Commented by: christophe derenne (cdr60530)

Hi, I'm surprised, because I love Firebird, this is a greate DBRM with very good performance for free. I'm using it since 15 years (before Firebird, I was using Interbase).
So I thank everybody who had work on this project.

But what ?
Ok you gave me a solution : thank you for that.
But Pavel Cisar closed the subject and indicate that it won't be fix ?

You are saying that substr function is buggy , will continue to exist wand will never be fixed !

I can't believe that, you should say, will be fixed later or will be deprecated : i would understand

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