Ads were blocked - no problem. But keep in mind that developing HeidiSQL, user support and hosting takes time and money. You may want to send a donation instead.

Warning dialog, where to view warnings?

SPlatten's profile image SPlatten posted 1 month ago in General Permalink

I am using HeidiSQL version 11.0.0.5919, I import a large SQL file previously created by myself using this version of HeidiSQL it exports the entire database with drop options selected. I am importing the file again to check it works.

After the import completes a dialog is displayed with the title "Training: Warning", Training is the name of the session I created. In the dialog body it displays:

Your query produced 48 warnings.

Warnings from last query:
Note: PROCEDURE training.updateThreat does not exist
  1. Where do I see these 48 warnings because the process window showing the import status doesn't show any errors or warnings from the import.
  2. The procedure it is telling me does not exist, actually does exist and having search the SQL file the only place it is mentioned is on the lines:
    DROP PROCEDURE IF EXISTS `updateThreat`;

    Then below this line the SQL that creates the PROCEDURE, it isn't called anywhere in the SQL, so why am I seeing this warning?

ansgar's profile image ansgar posted 1 month ago Permalink

You can fire a SHOW warnings; query to see the recent warnings. But note that you must do that in the session where you produced these warnings.

Also note that warnings are no show stopper, most of the time. For the above message I'd say that was a warning due to an DROP ... IF EXISTS.

ansgar's profile image ansgar posted 1 month ago Permalink

The fact that such things produce a warning was discussed elsewhere, here for tables: https://bugs.mysql.com/bug.php?id=2839

At least the approach is documented on https://dev.mysql.com/doc/refman/8.0/en/drop-procedure.html :

The IF EXISTS clause is a MySQL extension. It prevents an error from occurring if the procedure or function does not exist. A warning is produced that can be viewed with SHOW WARNINGS.

SPlatten's profile image SPlatten posted 1 month ago Permalink

Just tried that and despite the dialog telling me there are 48 warnings, when I execute:

SHOW WARNINGS;

The result is just 1:

Level = Note:
Code = 1,305
Message = PROCEDURE training.updateThreat does not exist
ansgar's profile image ansgar posted 1 month ago Permalink

I think these 48 refer to the whole script with multiple queries, and warnings get reset for each query generating at least one warning. HeidiSQL keeps track of the overall number of warnings, but doesn't store the messages.

SPlatten's profile image SPlatten posted 1 month ago Permalink

That would be a useful amendment to HeidiSQL don't you think?

ansgar's profile image ansgar posted 1 month ago Permalink

Useful probably, but that would also require to fire SHOW WARNINGS after each single query. Doing that in a large script with 100s of queries would annoy more than it helps or?

SPlatten's profile image SPlatten posted 1 month ago Permalink

Couldn't this be added as a checkbox option, something like Show Warnings after query which isn't checked by default ?

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




Ads were blocked - no problem. But keep in mind that developing HeidiSQL, user support and hosting takes time and money. You may want to send a donation instead.