distal-attribute
distal-attribute
distal-attribute
distal-attribute

0-Byte dumps

Husky110 posted 1 year ago in General

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 posted 1 year ago

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

kalvaro posted 1 year ago

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

Husky110 posted 1 year ago

correct.

ansgar posted 1 year ago

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

Husky110 posted 1 year ago

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

ansgar posted 1 year ago

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

ansgar posted 1 year ago

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.

Husky110 posted 1 year ago

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 posted 1 year ago

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 posted 1 year ago

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).

Husky110 posted 1 year ago

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.