Page 1 of 1

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

Posted: 22.03.2018, 16:46
by EMartin
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.

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

Posted: 23.03.2018, 11:50
by marsupilami
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

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

Posted: 23.03.2018, 19:51
by EMartin
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.

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

Posted: 23.03.2018, 21:02
by EMartin
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.

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

Posted: 24.03.2018, 11:14
by marsupilami
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

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

Posted: 26.03.2018, 15:41
by EMartin
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.

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

Posted: 26.03.2018, 18:32
by marsupilami
Hello Esteban,

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

Jan

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

Posted: 26.03.2018, 20:10
by EMartin
Jan, I can confirm you that the correction works (I guess with revision 4419 in ZDbcConnection.pas).

Thank you very much.

Esteban.