Bug #9024 Script parser doesn't 'see' code just uncommented/added
Submitted: 7 Mar 2005 16:13 Modified: 23 Apr 2005 7:44
Reporter: Emanuele Dolis Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Query Browser Severity:S2 (Serious)
Version:1.1.6 OS:Windows (Windows XP SP2)
Assigned to: CPU Architecture:Any

[7 Mar 2005 16:13] Emanuele Dolis
Description:
I use to divide the script in slots I uncomment to run selectively different parts of it.
If I uncomment a block, the block turns highlighted BUT the blu dots does not appear and the code is not executed.

The same seems to happen sometimes if you happen to add some code during debug.
even cutting and repasting seems useless.
The only solution seems to be saving, closing the script and reopening it.

I thik I'll be compelled to step back to 1.1.5 sobh....

Thanks for your efforts!

How to repeat:

sample block
______________________________________________________________
 #****************************************************************************
# some comment

#/*      line ALFA
DROP TABLE IF EXISTS  matrixas400.mCdTCA;

CREATE  TABLE matrixas400.mCdTCA (
TRTCA CHAR(2) NOT NULL PRIMARY KEY,      
DxTCA VARCHAR(40)                       
)ENGINE=InnoDB;

LOAD DATA LOCAL INFILE 'Z:\rrrr.txt'        #\\Datatrans\
INTO TABLE matrixas400.mCdTCA
FIELDS TERMINATED BY '\t' ESCAPED BY '' #ENCLOSED BY '"'
LINES TERMINATED BY '\r\n';
 /**/
____________________________________________________________

In 1.1.5 I used to remove just the "#" in Line ALFA to uncomment
now the text is highlighted but you cannot set breakpoint, there are no command identifiers and if you run the script the block is not executed

Now save the script, close the tab, reopen it - everything works now
[7 Mar 2005 17:14] MySQL Verification Team
If I understood well do you want to run the script
leaving the commented block in the below way ?:

#/*
....
*/
[8 Mar 2005 7:29] Emanuele Dolis
Sorry for not being clear, Miguel.
This is the code before (it is and is desider to be commented and ignored):
<quote>
/*      line ALFA

DROP TABLE IF EXISTS  matrixas400.mCdTCA;
CREATE  TABLE matrixas400.mCdTCA (
TRTCA CHAR(2) NOT NULL PRIMARY KEY,      
              )ENGINE=InnoDB;

 /**/    # LINE BETA
<\quote>
the comment spans from /* ..... /**/ and second comment #LINE BETA

When I want to uncomment I add # to line alfa, expecting the parser sees a first comment line  #/* ,then the ..... code, and then a third comment /**/ followed by a forth one #LINE BETA
<quote>
#/*      line ALFA

DROP TABLE IF EXISTS  matrixas400.mCdTCA;
CREATE  TABLE matrixas400.mCdTCA (
TRTCA CHAR(2) NOT NULL PRIMARY KEY,      
              )ENGINE=InnoDB;

 /**/    # LINE BETA
<\quote>
now line alfa is parsed as a common comment, the block is active but not executed.

Please note that this problem seems to be a bit general (not only related to this commenting trick), for instance if i remember well (now i'm working with version 1.1.5)
a)create a script which issues just a CREATE TABLE
b)run it the first time - of course everything ok
c)run it a second time-of course an error for table already existing arises.
d)without stopping the script, add before the statement a suitable DROP TABLE statement.
e) restart the script
[expected reaction: finds the DROP before the CREATE and everything OK now]
what happened was that (even endind the DROP statement with the correct ";") the parser seemed not to realize i added the line. (no blue dot, errors repeats running the modified script). [actual reaction: the error arises again]
If you cannot reproduce it, tell me - i'll reinstall 1.1.6 and chase the bug :)
Thanks 
emanuele
[8 Mar 2005 7:31] Emanuele Dolis
Uh, sorry Miguel - I've just realized that the first example was wrong (shame me!) Sorry but I'm working in a hurry these days....
[12 Mar 2005 21:48] Emanuele Dolis
Ok, Miguel, here I'm back .
Referring to the first example and working with 1.1.6
a) open sript window
b) paste what follows:
 #****************************************************************************
# some comment

#/*      line ALFA
DROP TABLE IF EXISTS  matrixas400.mCdTCA;

CREATE  TABLE matrixas400.mCdTCA (
TRTCA CHAR(2) NOT NULL PRIMARY KEY,
DxTCA VARCHAR(40)                       
)ENGINE=InnoDB;

LOAD DATA LOCAL INFILE 'Z:\rrrr.txt'        #\\Datatrans\
INTO TABLE matrixas400.mCdTCA
FIELDS TERMINATED BY '\t' ESCAPED BY '' #ENCLOSED BY '"'
LINES TERMINATED BY '\r\n';
 */
c) run the script. An error "file not found" of course is found at line 12 (correct behaviour: the code is parsed, highlighted and run.
d) now remove the # in line ALFA, the code now looks like
 #****************************************************************************
# some comment

/*      line ALFA
DROP TABLE IF EXISTS  matrixas400.mCdTCA;

CREATE  TABLE matrixas400.mCdTCA (
TRTCA CHAR(2) NOT NULL PRIMARY KEY,
DxTCA VARCHAR(40)                       
)ENGINE=InnoDB;

LOAD DATA LOCAL INFILE 'Z:\rrrr.txt'        #\\Datatrans\
INTO TABLE matrixas400.mCdTCA
FIELDS TERMINATED BY '\t' ESCAPED BY '' #ENCLOSED BY '"'
LINES TERMINATED BY '\r\n';
 */
and is grayed, in fact it' expected to be grayed (BUT the blue dots stay in place!)
e) run again the script - the expecting behaviour is a 'nothing to do' run istead you get again the error and (uh!) the grayed line is marked with blue...
f) save the script
g) reopen the script
h) run the script - now everything works fine...
[23 Mar 2005 7:44] Emanuele Dolis
Ahem...
has anyone examined my last posts?
This is a pretty invalidating matter, should I repost it in a new bug?
Thanks
Emanuele
[23 Apr 2005 23:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".