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

2.5.1 broke query that worked with 2.5.0. Changing just one CONTAINING to LIKE fixes the issue. [CORE3746] #4090

Closed
firebird-automations opened this issue Jan 31, 2012 · 13 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: flipo (zflipo)

Attachments:
Test.zip

2.5.1 broke query that worked with 2.5.0.

This will work on 2.5.1
select * from inventory,ItemComments where (ItemComments.GUID=Inventory.GUID) and ItemComments.Comments LIKE '%max%' and ...other Inventory CONTAINING tests

This does not work on 2.5.1 but works with 2.5.0 ( ie Firebird-2.5.0.26074_1_Win32.exe, Firebird-2.5.0.26074_1_x64.exe)
select * from inventory,ItemComments where (ItemComments.GUID=Inventory.GUID) and ItemComments.Comments CONTAINING 'max' and ...save other Inventory CONTAINING tests

The ItemComments.Comments is a blob and the other inventory CONTAINING usage is against a mix of varchar and blobs.

No errors reported just no info received back.

@firebird-automations
Copy link
Collaborator Author

Commented by: @asfernandes

We can do nothing without proper test case.

@firebird-automations
Copy link
Collaborator Author

Commented by: flipo (zflipo)

I'm working on preparing test database and code to submit.

@firebird-automations
Copy link
Collaborator Author

Commented by: Sean Leyne (seanleyne)

No, the "problem" may be solved with a later version of IBO, which you may need to update to. IBO bug are not a project responsibility.

@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

Commented by: flipo (zflipo)

Just saw your post.

I was incorrect about TIB_CURSOR working.

I don't give much hope on this being resolved as changing one CONTAINING to LIKE fixes the issue while same
sql statement still contains similar CONTAINING against blobs works.

thanks for your quick responses.

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

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

@firebird-automations
Copy link
Collaborator Author

Commented by: @AlexPeshkoff

Even with closed issue it seems that something may be wrong with 2.5.1. So - please prepare test case using our isql. This will save us all a lot of time, avoiding need to guess is it IBO or FB bug.

@firebird-automations
Copy link
Collaborator Author

Commented by: Damyan Ivanov (dam)

I tried the following query in isql on LI-V2.5.2.26424 Firebird 2.5 (amd64, snapshot from the 2.5 release branch) and it worked:

SQL> select first 1 id from events where details containing 'max';

               ID 

=====================
24945011169

events.details is BLOB segment 80, subtype TEXT CHARACTER SET UNICODE_FSS Nullable

@firebird-automations
Copy link
Collaborator Author

Commented by: flipo (zflipo)

OK,
I will send today offending fdb with some data.
Sorry for delay but pc decided to belly up yesterday.

@firebird-automations
Copy link
Collaborator Author

Commented by: flipo (zflipo)

Given that tbInventory is a TIB_Query

tbInventory.sql.text:= 'Select Inventory.*,ItemComments.comments from Inventory Left Join ItemComments on ItemComments.GUID=Inventory.GUID where Inventory.Server=:Server and ((ItemComments.Comments CONTAINING :PLike0) or (Slayer CONTAINING :PLike0) or (ReqSkillName CONTAINING :PLike0) or (Itemname CONTAINING :PLike0) or (SpellNames CONTAINING :PLike0 ) or (SetNumber CONTAINING :PLike0 ) or (Cast(WieldReqAmount as VARCHAR(20) )=:P0) or (Cast(ArmourLevel as VARCHAR(20) ) = :P0) )'

..do setting of parameters.
execute returns only column headings.

If prior to execute I change the tbInventory.Sql via a call to a function which generate a new sql statment that utilizing that same tbInventory.sql.text and tbinventory.Sql.Params[x] executing that will provide data.

set tbInventory.sql.text as above and
do setting of parameters.

NewSql:=GetSQLWithParamData(tbInventory);

//newsql returns for my test 'Select Inventory.*,ItemComments.comments from Inventory Left Join ItemComments on ItemComments.GUID=Inventory.GUID where Inventory.Server='Solclaim' and ((ItemComments.Comments CONTAINING 'Key') or (Slayer CONTAINING 'Key') or (ReqSkillName CONTAINING 'Key') or (Itemname CONTAINING 'Key') or (SpellNames CONTAINING 'Key' ) or (SetNumber CONTAINING 'Key' ) or (Cast(WieldReqAmount as VARCHAR(20) )='Key') or (Cast(ArmourLevel as VARCHAR(20) ) = 'Key') )'

tbInventory.sql.text:=NewSql;
execute returns column headings and data.

@firebird-automations
Copy link
Collaborator Author

Modified by: flipo (zflipo)

Attachment: Test.zip [ 12096 ]

@firebird-automations
Copy link
Collaborator Author

Commented by: flipo (zflipo)

It appears that TBI_query is having trouble generating a valid sql statement based on what version of firebird.

I know that if you change just the following
(ItemComments.Comments CONTAINING 'Key')
to
(ItemComments.Comments LIKE '%Key%')
That the query is working again.

So yes something about Firebird 2.1.5 is causing IBO to have issues.

Given that a explicit sql statement works it points to IBO issue. Given that sql works against prior FB 2.1.5 it points to firebird.

Now i have to go figure out what is going on with users who upgraded to 2.1.5 and then reverted to 2.1.0 as they are reporting that a different query has stopped working.

Thanks for your effort. I've enjoyed blissful use of Firebird since the 1.x days.

@firebird-automations
Copy link
Collaborator Author

Commented by: @AlexPeshkoff

Well, it looks like I've EXLICITLY written - do it using _isql_.

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