period "." in view name

fbachofner's profile image fbachofner posted 11 years ago in General Permalink
I have some views which are named similar to:

v.tablename.selects_something_special

I find the "." to be a handy visual delimiter.

As of MySQL 5.1.6 a period is a legal character in Schema object names (see http://dev.mysql.com/doc/refman/5.1/en/identifiers.html )

Unfortunately, HeidiSQL crashes when I click on views with such names. [build 8.0.0.4482 (and earlier) ]

Is this a oversight (since 5.1.6 was released), bug, or intended feature not implemented quite gracefully?

Continued thanks for a great program!
ansgar's profile image ansgar posted 11 years ago Permalink
Well the bug is that HeidiSQL does not expect dots in a name of a view, but it needs a dot between db and view. Most probably a regular expression somewhere in my ParseViewStructure method. Can you please post the very top lines of the callstack here?
kalvaro's profile image kalvaro posted 11 years ago Permalink
It doesn't crash for me, but it runs the wrong internal command every time it attempts to fetch information from the view:

SHOW /*!32332 FULL */ COLUMNS FROM `foo`.`bar`;


... rather than:

SHOW /*!32332 FULL */ COLUMNS FROM `foo.bar`;
kalvaro's profile image kalvaro posted 11 years ago Permalink
Oh, sorry, I had 4474 and latest version is 4482. Now the internal query is correct but I do get the crash:

date/time         : 2013-08-14, 08:15:36, 148ms
operating system  : Windows 7 x64 Service Pack 1 build 7601
system language   : Spanish
system up time    : 2 days
program up time   : 1 minute 47 seconds
processors        : 2x AMD Athlon(tm) 64 X2 Dual Core Processor 4000+
physical memory   : 1187/4096 MB (free/total)
free disk space   : (C:) 73,09 GB (D:) 71,24 GB
display mode      : 1280x1024, 32 bit
process id        : $19c4
allocated memory  : 47,87 MB
executable        : heidisql.exe
exec. date/time   : 2013-08-14 08:13
version           : 8.0.0.4482
compiled with     : Delphi XE
madExcept version : 3.0m beta 1
callstack crc     : $f4cf3b16, $95e3012e, $95e3012e
exception number  : 1
exception class   : Exception
exception message : Regular expression did not match the VIEW code in ParseViewStructure(): CREATE ALGORITHM=UNDEFINED DEFINER=`oms`@`%` SQL SECURITY DEFINER VIEW `v.tablename.selects_something_special` AS select 2 AS `2`.
main thread ($930):
0073041f heidisql.exe dbconnection 3565 +26 TDBConnection.ParseViewStructure
00801088 heidisql.exe Main         7378 +62 TMainForm.DBtreeFocusChanged
006250fe heidisql.exe VirtualTrees          TBaseVirtualTree.DoFocusChange
0062949a heidisql.exe VirtualTrees          TBaseVirtualTree.HandleMouseDown
004e9bd0 heidisql.exe Controls              TControl.DoMouseDown
0062149c heidisql.exe VirtualTrees          TBaseVirtualTree.WMLButtonDown
0062db3f heidisql.exe VirtualTrees          TBaseVirtualTree.WndProc
004ed4dc heidisql.exe Controls              TWinControl.MainWndProc
004abb0c heidisql.exe Classes               StdWndProc
75167885 USER32.dll                         DispatchMessageW
0057864b heidisql.exe Forms                 TApplication.ProcessMessage
0057868e heidisql.exe Forms                 TApplication.HandleMessage
005789b9 heidisql.exe Forms                 TApplication.Run
0081ebe2 heidisql.exe heidisql       74 +22 initialization
756433a8 kernel32.dll                       BaseThreadInitThunk
ansgar's profile image ansgar posted 11 years ago Permalink
Thanks for the callstack. Going to check that.
ansgar's profile image ansgar posted 11 years ago Permalink
Ok, using *one* dot in the view's name works, just two or more raise the exception.
Code modification/commit from ansgar.becker, 11 years ago, revision 8.0.0.4483
Make regex in ParseViewStructure even more loose, this time due to dots in the view's name. See http://www.heidisql.com/forum.php?t=13191
ansgar's profile image ansgar posted 11 years ago Permalink
r4483 works here when using 1, 2, or hundreds of dots in a view name. The only char which may not be present in the view name is now the opening parenthesis (, as I need to detect the columns clause after the view name, and I cannot just use .* here.
fbachofner's profile image fbachofner posted 11 years ago Permalink

r4483 works here when using 1, 2, or hundreds of dots in a view name.



WooHoo! It works. Fantastisch. Vielen Dank Ansgar!

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