0-Byte dumps

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

Greetings,

I recently discovered that Heidi-SQL (Version 9.3.0.4984) creates 0-Byte-Files if the Filname contains ":" in it. Example: "mydb-2016-03-11-10:22.sql" I could recreate that behavior on my machine (Windows 7) twice. Maybe someone should someone take a look into that one.

Husky110

TTSneko's profile image TTSneko posted 8 years ago Permalink

Since when are characters like colons, semicolons, and such legal elements of a [b]filename[/b]?

kalvaro's profile image kalvaro posted 8 years ago Permalink

I guess he meant that HeidiSQL should give a warning or something, rather than proceed normally and dump data to God knows where.

[expired user #9682]'s profile image [expired user #9682] posted 8 years ago Permalink

correct.

ansgar's profile image ansgar posted 8 years ago Permalink

Confirmed. I should call HasValidFileNameChars() on the text before trying to create the file.

[expired user #9682]'s profile image [expired user #9682] posted 8 years ago Permalink

Sounds like a great idea. ;) Btw: What happened to the data that has been dumped anyway?

ansgar's profile image ansgar posted 8 years ago Permalink

I guess Heidi wrote it to the stream which itself was not able to write to disk, so I'm afraid it's gone.

Code modification/commit from ansgarbecker, 8 years ago, revision 9.3.0.5053
Warn if export output filename contains illegal characters, which TFileStream.Create does not catch for some reason. See http://www.heidisql.com/forum.php?t=20873
ansgar's profile image ansgar posted 8 years ago Permalink

Added an error message in r5053, saying that the file name contains illegal characters when user clicks the Export button. I'm scratching my head why TFileStream.Create does not catch such errors, as it also complaints in other cases when the file cannot be created, e.g. if the target file is in use.

[expired user #9682]'s profile image [expired user #9682] posted 8 years ago Permalink

I could think of 2 reasons. 1.) the error is already been processed somewhere but not thrown to the user - 2.) a deeper bug

ansgar's profile image ansgar posted 8 years ago Permalink

To me it looks like a bug in TFileStream.Create, as in my testcase I got a file afterwards with the characters up to the colon. I wanted C:\some\path\foo:bar.sql and got C:\some\path\foo. Apart from that wrong filename, the file was empty, as you also described.

TTSneko's profile image TTSneko posted 8 years ago Permalink

AFAIK TFileStreamCreate does not filter as it has certain functions (e.g. piping) in mind, meaning that it also handles scripting and redirection syntax. As the output "breaks" on the colon it is obviously thinking you are streaming data to or through a pipe device. Per default that would be NUL:/NIL: (hence the data is streamed into Nirvana).

[expired user #9682]'s profile image [expired user #9682] posted 8 years ago Permalink

which is good in 99% of the cases until you got into the 1%ers... ;)

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