Toad World® Forums

Bad SQL Code Causing Parser to Freeze on File Open

I know you are working on the parser (QP5.dll), so please consider this a “just in case you don’t already know” report.

Try saving the following, erroneous, SQL code into the file “Test.sql”, then open the file into Toad 6.1 Beta:

INSERT INTO Table1 (Column1 FROM BigTable AS bt;

I get a freeze every time and have to kill Toad from the Task Manager.

When I replace QP5.dll in my Toad 6.0 production release with the beta version the same freeze occurs. Restoring the original QP5.dll fixes the problem. Which is a shame because the beta QP5.dll partially addresses some of the issues reported on this thread.

Thanks,

KJ

Could you paste the version numbers (e.g., 5.240) of both “bad” and “good” DLL?

Thanks,

Andre

Here are the QP5.dll versions (“Type” in the Explorer Properties window):

GOOD: 5.252.13127.32847 (from my 6.0 full install)

BAD: 5.253.13175.15155 (from either of the two 6.1 betas)

The latter does somewhat improved handling of AND - OR indentation, though it’s still missing the latest additions to that thread.

  • KJ

Can’t reproduce using default formatter options, both 252 and 253 format fine, no hangs. Could you please post your formatter options here, you can copy them from the top pane of the formatter options (button “Copy Options to Clipboard”) ?

Thanks,
Andre

Hi Andre,

Thanks for following-up on this. How odd: certainly in the latest beta 6.1.0.122 even applying the Default formatter on that particular test string causes Toad to freeze.

There are no issues with the older QP5.dll. For example, a totally clean install of Freeware 6.0 doesn’t freeze on formatting that string or opening a .sql file with that string in it.

This is my Default formatter from Beta 6.1.0.122:

252

5.253.0

5.253

10

2

1

1

1

999

<LF_LimitLinefeeds>0</LF_LimitLinefeeds>

1

0

1

2

0

0

99

3

2

0

Hi KJ,

It turns out that I was testing with a wrong setting, apolo me, in fact I can reproduce it. It has nothing to do with formatting, it’s a parser bug. So version 252 yields a regular error, 253 just hangs.

The good news is that it has already been fixed in the next version, 5.254. You can probably grab that one from the latest Toad for Oracle beta, perhaps also Toad for Sql Server beta - not sure at all.

Hope this helps,

Thanks,

Andre

Hi Andre,

I agree the problem is the parser (QP5.dll, right?), not the formatter. That is why I originally detailed the problem being triggered by opening a file, rather than by running the Formatter. Equivalently, you can try saving a .sql file with that statement buried in it.

No matter: I’m sure it’s just a temporary bug in the beta version of QP5.dll from the SQL Server version. I will have a go with the QP5.dll from the latest Oracle beta and let you know.

BTW the latest SQL Server beta (6.1.0.122) has the same QP5.dll as the previous beta, so the problem manifests in both extant SQL Server 6.1 betas.

Thanks,

KJ

The QP5.dll from the latest Toad for Oracle beta indeed does not suffer the same problem, thanks! It doesn’t have any further improvements regarding the issues on WHERE/MERGE (from the “AND - OR” thread) as compared to the latest Toad for SQL Server beta QP5.dll, but at least it does not freeze Toad.

FYI: The QP5.dll from Toad for Oracle beta is version 5.254.13202.43190, just as Andre instructed.

Thanks again.

( BTW, no need to challenge your nerves by trying to type over the 3rd and 4rd part of the version number, “5.254” will suffice; there is only one 5.254; part 3 & 4 are just timestamp attributes: year (20)13, day 202, second 2 * 43190 of that day, i.e. at about midnight – version numbers are limited to 64K )

Thanks

(Lol woops, apologies. Got it, thanks.)