Hello,
On Fri, Oct 26, 2007 at 01:26:10PM +0200, Magnus Svensson wrote:
>
> tor 2007-10-25 klockan 21:45 +0200 skrev Guilhem Bichot:
> > Hello Magnus,
> >
> > On Mon, Oct 22, 2007 at 10:56:29AM +0200, msvensson@stripped wrote:
> > > Below is the list of changes that have just been committed into a local
> > > 5.0 repository of msvensson. When msvensson does a push these changes will
> > > be propagated to the main repository and, within 24 hours after the
> > > push, to the public repository.
> > > For information on how to access the public repository
> > > see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
> > >
> > > ChangeSet@stripped, 2007-10-22 10:56:26+02:00, msvensson@stripped +10
> -0
> > > Bug#31741 mysqltest - deprecate "system" command
> > > diff -Nrup a/mysql-test/t/ndb_autodiscover.test
> b/mysql-test/t/ndb_autodiscover.test
> > > --- a/mysql-test/t/ndb_autodiscover.test 2006-01-24 08:30:48 +01:00
> > > +++ b/mysql-test/t/ndb_autodiscover.test 2007-10-22 10:56:23 +02:00
> >
> > > @@ -85,7 +85,10 @@ show status like 'handler_discover%';
> > > flush tables;
> > >
> > > # Modify the frm file on disk
> > > -system echo "blaj" >> $MYSQLTEST_VARDIR/master-data/test/t2.frm ;
> > > +remove_file $MYSQLTEST_VARDIR/master-data/test/t2.frm;
> > > +write_file $MYSQLTEST_VARDIR/master-data/test/t2.frm;
> > > +blaj
> > > +EOF
> >
> > the system used >> so appended to the file.
> > The new commands are rather equivalent to > (remove before appending),
> > Probably you can just remove the remove_file.
>
> That is correct! I'll take out the "remove_file" and use "append_file"
> instead of "write_file"
aha, I didn't know we had append_file, I thought write_file would
append. But now I realize that that append_file exists and write_file
will fail if the file exists. With this in mind, there is one places
of your patch where the old system command used >> and you converted
it to write_file, which is thus theoretically incorrect:
diff -Nrup a/mysql-test/t/show_check.test b/mysql-test/t/show_check.test
--- a/mysql-test/t/show_check.test 2007-08-02 15:23:14 +02:00
+++ b/mysql-test/t/show_check.test 2007-10-22 10:56:23 +02:00
@@ -427,7 +427,9 @@ DROP TABLE t1;
flush tables;
# Create a junk frm file on disk
-system echo "this is a junk file for test" >>
$MYSQLTEST_VARDIR/master-data/test/t1.frm ;
+write_file $MYSQLTEST_VARDIR/master-data/test/t1.frm;
+this is a junk file for test
+EOF
> >
> > > @@ -200,7 +203,7 @@ insert into t4 values (1, "Automatic");
> > > select * from t4;
> > >
> > > # Remove the table from NDB
> > > -system exec $NDB_TOOLS_DIR/ndb_drop_table --no-defaults -d test t4
> >> $NDB_TOOLS_OUTPUT ;
> > > +--exec $NDB_TOOLS_DIR/ndb_drop_table --no-defaults -d test t4 >>
> $NDB_TOOLS_OUTPUT ;
> >
> > "remove_file" has no --, "--exec" has...
> > I don't care, just a note.
>
> As you probably know a -- command is always terminated by newline("\n").
> Otherwise a command is terminated by current delimiter, default ";"
I never knew or I forgot :)
> That means the "--exec <command>;" will actually execute the command
> including the semicolon. Which is kind of a bug. I'll change it to use
> no -- at all.
ok
> There is actually a gotcha in using "--<mysqltest command>". Since it's
> interpreted as a "comment in command", we can't detect if it's
> misspelled. Oouch, we just think it's a comment. But, a line will be
> added to the <testname>.warning file. I have some idea to totally
> disallow -- as the start of a comment. Some people argue that since it's
> a legal SQL comment - we should allow it. But I would rather dissallow
> it as a _comment_ and only treat it as a "command ended by newline".
>
> What do you think? Remeber this is not SQL, it's mysqltest
> language. ;)
I agree with you. Currently, when mysqltest sees a "--" line it does
not send the '-- etc' line to mysqld in any case; either it recognizes
a mysqltest command and executes it, or it recognizes a comment and
does not send it either.
--
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Mr. Guilhem Bichot <guilhem@stripped>
/ /|_/ / // /\ \/ /_/ / /__ MySQL AB, Lead Software Engineer
/_/ /_/\_, /___/\___\_\___/ Bordeaux, France
<___/ www.mysql.com