Application crashes when typing SELECT * FROM then hitting CTRL + Space

[expired user #8841]'s profile image [expired user #8841] posted 8 years ago in General Permalink
Hi,

as the subject already states, the application crashes when trying to show the autocomplete window. It worked in the past but it is broken since the recent 3 build. The server is a Microsoft SQL Server 2008.

So lonG
Daniel
1 attachment(s):
[expired user #8841]'s profile image [expired user #8841] posted 8 years ago Permalink
The issue is fixed in 9.3.0.5007, yay!
[expired user #8841]'s profile image [expired user #8841] posted 8 years ago Permalink
I was wrong, bug is not fixed, it occurs in connection with specific tables only.
ansgar's profile image ansgar posted 8 years ago Permalink
Then, what tables and what is specific with these?
[expired user #8841]'s profile image [expired user #8841] posted 8 years ago Permalink
Hi there, can you specify which table information you need to reproduce the bug? Did you have a look at the bug report?
ansgar's profile image ansgar posted 8 years ago Permalink
The bug report tells about an error without an actual error message. So I cannot see anything which refers to the cause of this issue. You should definitely post the CREATE TABLE code for one or two tables here.
[expired user #8841]'s profile image [expired user #8841] posted 8 years ago Permalink
Hi, i dont think its the database structure that causes the issue. Here is a simple script to create a test DB:

-- --------------------------------------------------------

-- Host:                         ms-navsql-1

-- Server version:               Microsoft SQL Server 2008 R2 (SP3) - 10.50.6220.0

-- Server OS:                    Windows NT 6.1 <X64> (Build 7601: Service Pack 1)

-- HeidiSQL Version:             9.3.0.5009

-- --------------------------------------------------------


CREATE DATABASE "TestDB";
USE "TestDB";
CREATE TABLE "TestTable" ("ID" INT NOT NULL);
INSERT INTO "TestTable" ("ID") VALUES (1), (2), (3);


I bet Heidi will work flawlessly on your machine but strangely Heidi crashes on mine.
[expired user #8841]'s profile image [expired user #8841] posted 8 years ago Permalink
Ok, i have tried several older versions of HeidiSQL and the bug seems to be introduced by revision 9.3.0.4990. Here is a quote of yours taken from here:

I just introduced some sort of query caching, deeply in HeidiSQL's connection code. This is highly experimental ... This query caching is yet only used in the case you described - when the completion proposal pops up and fires certain queries for ...



This matches exactly the issue.

I'm going to analyze the queries displayed in the log window when the popup comes up, i think these are the culprit.
[expired user #8841]'s profile image [expired user #8841] posted 8 years ago Permalink
Yay, found it. The issue is in fact caused by the queries executed when the completion proposal pops up.

I have a DB that looks like this



whereas HeidiSQL can display the popup successfully. But then i have a DB that looks like this



whereas HeidiSQL crashes as described in the first post.

As you can see the function dbo.base64_decode and dbo.base64_encode is missing.

So when HeidiSQL tries to executed the following queries

... EXEC sp_helptext 'dbo.base64_decode';EXEC sp_helptext 'dbo.base64_encode'; ...


a crash occures most likely due to a missing sanity check that causes an access violation.

I have created dbo.base64_decode and dbo.base64_encode manually and the issue is gone.

It would be nice to have some sort of hint displayed to the user when these functions are missing.

Please login to leave a reply, or register at first.