Firebird error "Wildcard searches are not suported with Firebird 1.5 and 1.0 ..."

The forum for ZeosLib 7.2 Report problems. Ask for help, post proposals for the new version and Zeoslib 7.2 features here. This is a forum that will be edited once the 7.2.x version goes into RC/stable!!

My personal intention for 7.2 is to speed up the internals as optimal a possible for all IDE's. Hope you can help?! Have fun with testing 7.2
EMartin
Fresh Boarder
Fresh Boarder
Posts: 5
Joined: 22.03.2018, 16:39

Firebird error "Wildcard searches are not suported with Firebird 1.5 and 1.0 ..."

Postby EMartin » 22.03.2018, 16:46

Hi, I updated Zeos to 7.2 rev.4401 and I am having this exception (using Zeos with mORMot):

Code: Select all

 EZSQLException ("Wildcard searches are not suported with Firebird 1.5 and 1.0. Use IZDatabaseMetadata.AddEscapeCharToWildcards to escape wildcards in table names.") at 006BEE88 ZDbcInterbase6Metadata.TZInterbase6DatabaseMetadata.ConstructNameCondition (1273)  stack trace API 006BEE88 ZDbcInterbase6Metadata.TZInterbase6DatabaseMetadata.ConstructNameCondition (1273) 006C0286 ZDbcInterbase6Metadata.TZInterbase6DatabaseMetadata.UncachedGetColumns (1768) 00615B49 ZDbcMetadata.TZAbstractDatabaseMetadata.GetColumns (3199) 0074977C SynDBZeos.TSQLDBZEOSConnectionProperties.GetFields (639) 007EBEF1 mORMotDB.GetFields (767)
 


In previous version (two-three months ago) I have not this error. I'm using Firebird 2.5.

Any help I'll appreciate.

Best regards.

Esteban.

marsupilami
Gold Boarder
Gold Boarder
Posts: 671
Joined: 17.01.2011, 14:17

Re: Firebird error "Wildcard searches are not suported with Firebird 1.5 and 1.0 ..."

Postby marsupilami » 23.03.2018, 11:50

Hello Esteban,

we (Egonhugeist and me) checked our code and tested with Firebird 2.5. We couldn't reproduce your issue unfortunately. Are you sure that the server is of version 2.5 and not only your client library? Could you try to debug into TZInterbase6DatabaseInfo.CollectServerInformations, unit ZDbcInterbase6Metadata, to see what happens there?
Usually Zeos should determine the server version there and work accordingly later on. Please check especially the FServerVersion variable because it will contain the server version as returned by Firebird.

Edit: We found one loop hole where things could raise this error: If you call GetColumns before you open the connection, this error would be generated. But this shouldn't have changed during the last months...

With best regards,

Jan

EMartin
Fresh Boarder
Fresh Boarder
Posts: 5
Joined: 22.03.2018, 16:39

Re: Firebird error "Wildcard searches are not suported with Firebird 1.5 and 1.0 ..."

Postby EMartin » 23.03.2018, 19:51

Thanks Jan for you reply, and ...

Edit: We found one loop hole where things could raise this error: If you call GetColumns before you open the connection, this error would be generated. But this shouldn't have changed during the last months...


... it seems to be the case, the mORMot framework create the ORM tables and use the GetColumn method, with former version de Zeos I have not this error, and the same only is raised when a table name has an underscore in the name, for example: APPROACH_PARAMETERS.

Thanks.

Esteban.

EMartin
Fresh Boarder
Fresh Boarder
Posts: 5
Joined: 22.03.2018, 16:39

Re: Firebird error "Wildcard searches are not suported with Firebird 1.5 and 1.0 ..."

Postby EMartin » 23.03.2018, 21:02

I solved this error connecting to database when initiliazing mORMot interfaced based service, I'm not happy with this patch because formely weren't need. Can you to implement another solution ?

Thanks.

Esteban.

marsupilami
Gold Boarder
Gold Boarder
Posts: 671
Joined: 17.01.2011, 14:17

Re: Firebird error "Wildcard searches are not suported with Firebird 1.5 and 1.0 ..."

Postby marsupilami » 24.03.2018, 11:14

Hello Esteban,

well there are several thigs here. Short version:
  • Zeos will now automatically connect to the database as soon as IZConnection.GetMetadata is called. This should resolve your immediate problem.
  • mORMot should use IZconnection.GetMetadata.AddEscapeCharToWildcards to escape the underscore in APPROACH_PARAMETERS if it only wants information about that table. This is because GetColumns allows to add wildcards to identifiers and _ is a wildcard. A search for APPROACH_PARAMETERS will also give resultes for APPROACH2PARAMETERS, whereas a search for APPROACH\_PARAMETERS will give correct results.

Long version:
The Zeos API allows to search for information about more than one table by adding wildcards (i.e. _ and %) to identifier names. mORMot seems to push APPROACH_PARAMETERS into the GetColumns method of IZDatabaseMetadata without properly escaping the wildcard _ . Two years ago I added a patch to the firebird driver that was meant to raise an exception if somebody tries to do a wildcard search on Firebird versions 1.5 and below because that couldn't be done reliably. Unfortunately a small mistake slipped into the driver at some time that reversed the meaning - Zeos didn't try to do such searches if the database version was 2.0 and up. About 6 weeks ago Egonhugeist corrected that.
Since you were not connected to the database, Zeos thought you were connected to a Firebird version 0. In the old code, this didn't trigger a problem for you. After the correction Zeos correctly detemined that a Firebird server Version 0.0 never could do wildcard searches properly. This triggered the exception in your code.

With best regards,

Jan

EMartin
Fresh Boarder
Fresh Boarder
Posts: 5
Joined: 22.03.2018, 16:39

Re: Firebird error "Wildcard searches are not suported with Firebird 1.5 and 1.0 ..."

Postby EMartin » 26.03.2018, 15:41

Thanks Jan for your explanation.

Zeos will now automatically connect to the database as soon as IZConnection.GetMetadata is called. This should resolve your immediate problem.


When this modification would be ready ?

Best regard.

Esteban.

marsupilami
Gold Boarder
Gold Boarder
Posts: 671
Joined: 17.01.2011, 14:17

Re: Firebird error "Wildcard searches are not suported with Firebird 1.5 and 1.0 ..."

Postby marsupilami » 26.03.2018, 18:32

Hello Esteban,

as far as I know, it should pe part of the current stable version of Zeos 7.2.
Best regards,

Jan

EMartin
Fresh Boarder
Fresh Boarder
Posts: 5
Joined: 22.03.2018, 16:39

[SOLVED]Re: Firebird error "Wildcard searches are not suported with Firebird 1.5 and 1.0 ..."

Postby EMartin » 26.03.2018, 20:10

Jan, I can confirm you that the correction works (I guess with revision 4419 in ZDbcConnection.pas).

Thank you very much.

Esteban.


Return to “ZeosLib 7.2 Forum”

Who is online

Users browsing this forum: No registered users and 1 guest