View Issue Details

IDProjectCategoryView StatusLast Update
0006885VALENTINA STUDIOTool - SQL Editorpublic2019-09-28 08:04
Reporterloenk2xAssigned ToIgor Nikitin 
PriorityhighSeverityblockReproducibilityalways
Status resolvedResolutionfixed 
PlatformINTELOSMac OS OS Version10.9
Product Version5.5.4 
Target Version9.6.xFixed in Version9.6.x 
Summary0006885: Executing truncate/create in SQL editor not working
DescriptionHi.

I have several queries loaded in the SQL editor, like this:

SET FOREIGN_KEY_CHECKS = 0;
TRUNCATE TABLE table1;
TRUNCATE TABLE table2;
TRUNCATE TABLE table3;
SET FOREIGN_KEY_CHECKS = 1;

Engine is InnoDB. Executing the queries did not resulting in any errors. But the tables were not truncated at all.

The same when i tried to create tables using the SQL editor. While executing select queries went just fine.

TagsNo tags attached.
Working with DB:mySQL Server
Version of your DB

Activities

Ruslan Zasukhin

Ruslan Zasukhin

2014-07-03 12:33

administrator   ~0007819

Can you check if this not works in newest 5.5.8 ?
loenk2x

loenk2x

2014-07-09 04:21

reporter   ~0007824

Yes, this is still not working in 5.5.8. I tried to load SQL dump to a specific opened database, and executed the queries. The tables were nowhere to be found. The database was still empty when the execution finished. I tried several times. No luck.
loenk2x

loenk2x

2014-07-09 04:28

reporter   ~0007825

ok, funny thing just happened. I removed comments like this in the SQL dump:

-- ----------------------------
-- Table structure for `exp_accessories`
-- ----------------------------

The tables were created after I removed these. But the queries **below** that comment lines were still not executed.
Sergey Pashkov

Sergey Pashkov

2014-07-09 07:52

developer   ~0007827

Can you attach your SQL file, please?
What app have you used to create it?
Sergey Pashkov

Sergey Pashkov

2014-07-09 10:07

developer   ~0007828

These comment lines contain specific line ending - CR (without LF).

The problem is that MySQL server doesn't handle it for some reason,
so everything after '-- ' is treated as a comment.

SQL Editor executes queries 'as is' without any modification or parsing.
loenk2x

loenk2x

2014-07-09 12:22

reporter   ~0007829

That's actually weird. Because I can import the SQL log file using mysql CLI without any hitch. That's in the same machine.

About CR without LF, i thought that's common for *NIX systems, including Mac OS X?
Ruslan Zasukhin

Ruslan Zasukhin

2014-07-09 12:26

administrator   ~0007830

a) may be CLI do some job converting that end lines?

b) CR yes linux + macosx

c) may be studio take file with CR, but says to mySQL server something else? e.g. win encoding?
loenk2x

loenk2x

2014-07-09 13:17

reporter   ~0007831

Confirmed.

- I tried to type the queries by hand, with the comment lines block as well, and studio executed it very well.
- And then I tried to copy and paste the query directly from the dump with the comment lines block; queries after the comments block was not executed.
- And then I tried to replace the new line characters within the comment lines block. Execution was perfect; the tables were all created successfully.

I'm not sure about where I got the CR encoding problem. I don't use any windows environment, so that shouldn't be the cause.
Sergey Pashkov

Sergey Pashkov

2014-07-09 13:46

developer   ~0007832

According to http://en.wikipedia.org/wiki/Newline:
CR is from Mac OS up to 9, Unix uses LF, Windows uses CR+LF

Valentina Studio sends a query right in the same form as it was typed/inserted.
Confirmed it by checking the query logs of MySQL server.

So CR line ending is not recognized at all.

I've checked another application:
1) it splits query into separate statements;
2) replaces all individual CRs to LFs (except for CRs in the quoted strings).
Ruslan Zasukhin

Ruslan Zasukhin

2014-07-09 19:09

administrator   ~0007833

so where from you get this DUMP file?

which app produce it? mySQL itself? Else?
Sounds like some old enough Carbon Mac App ?
Igor Nikitin

Igor Nikitin

2019-09-28 08:04

developer   ~0011001

Currently used version of scintilla auto converts line endings on paste an external text (tested). Line endings are SC_EOL_LF for all platforms now.

Issue History

Date Modified Username Field Change
2014-07-03 10:48 loenk2x New Issue
2014-07-03 12:31 Ruslan Zasukhin Assigned To => Sergey Pashkov
2014-07-03 12:31 Ruslan Zasukhin Status new => assigned
2014-07-03 12:33 Ruslan Zasukhin Target Version => 5.6
2014-07-03 12:33 Ruslan Zasukhin Note Added: 0007819
2014-07-09 04:21 loenk2x Note Added: 0007824
2014-07-09 04:28 loenk2x Note Added: 0007825
2014-07-09 06:44 Sergey Pashkov Status assigned => confirmed
2014-07-09 07:52 Sergey Pashkov Note Added: 0007827
2014-07-09 10:07 Sergey Pashkov Note Added: 0007828
2014-07-09 12:22 loenk2x Note Added: 0007829
2014-07-09 12:26 Ruslan Zasukhin Note Added: 0007830
2014-07-09 13:17 loenk2x Note Added: 0007831
2014-07-09 13:46 Sergey Pashkov Note Added: 0007832
2014-07-09 19:09 Ruslan Zasukhin Note Added: 0007833
2018-09-25 09:58 Ruslan Zasukhin Target Version TODO_BUGS => 8.6.x
2019-09-28 08:04 Igor Nikitin Assigned To Sergey Pashkov => Igor Nikitin
2019-09-28 08:04 Igor Nikitin Status confirmed => resolved
2019-09-28 08:04 Igor Nikitin Resolution open => fixed
2019-09-28 08:04 Igor Nikitin Fixed in Version => 9.6.x
2019-09-28 08:04 Igor Nikitin Note Added: 0011001