Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
a2f59d74
Commit
a2f59d74
authored
Aug 08, 2007
by
msvensson@pilot.(none)
Browse files
Options
Browse Files
Download
Plain Diff
Merge 192.168.0.7:mysql/mysql-5.0-maint
into pilot.(none):/data/msvensson/mysql/mysql-5.0-maint
parents
912aad3b
792ac3fd
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
8 deletions
+42
-8
client/mysqltest.c
client/mysqltest.c
+40
-8
mysql-test/r/mysqltest.result
mysql-test/r/mysqltest.result
+1
-0
mysql-test/t/mysqltest.test
mysql-test/t/mysqltest.test
+1
-0
No files found.
client/mysqltest.c
View file @
a2f59d74
...
...
@@ -753,6 +753,15 @@ void check_command_args(struct st_command *command,
command
->
first_word_len
,
command
->
query
);
}
/* Check for too many arguments passed */
ptr
=
command
->
last_argument
;
while
(
ptr
<=
command
->
end
)
{
if
(
*
ptr
&&
*
ptr
!=
' '
)
die
(
"Extra argument '%s' passed to '%.*s'"
,
ptr
,
command
->
first_word_len
,
command
->
query
);
ptr
++
;
}
DBUG_VOID_RETURN
;
}
...
...
@@ -2691,8 +2700,22 @@ void read_until_delimiter(DYNAMIC_STRING *ds,
c
=
my_getc
(
cur_file
->
file
);
if
(
c
==
'\n'
)
{
cur_file
->
lineno
++
;
/* Skip newline from the same line as the command */
if
(
start_lineno
==
(
cur_file
->
lineno
-
1
))
continue
;
}
else
if
(
start_lineno
==
cur_file
->
lineno
)
{
/*
No characters except \n are allowed on
the same line as the command
*/
die
(
"Trailing characters found after command"
);
}
if
(
feof
(
cur_file
->
file
))
die
(
"End of file encountered before '%s' delimiter was found"
,
ds_delimiter
->
str
);
...
...
@@ -2953,8 +2976,10 @@ void do_send_quit(struct st_command *command)
void
do_perl
(
struct
st_command
*
command
)
{
int
error
;
char
buf
[
FN_REFLEN
]
;
File
fd
;
FILE
*
res_file
;
char
buf
[
FN_REFLEN
];
char
temp_file_path
[
FN_REFLEN
];
static
DYNAMIC_STRING
ds_script
;
static
DYNAMIC_STRING
ds_delimiter
;
const
struct
command_arg
perl_args
[]
=
{
...
...
@@ -2977,14 +3002,17 @@ void do_perl(struct st_command *command)
DBUG_PRINT
(
"info"
,
(
"Executing perl: %s"
,
ds_script
.
str
));
/* Format a name for a tmp .pl file that is unique for this process */
my_snprintf
(
buf
,
sizeof
(
buf
),
"%s/tmp/tmp_%d.pl"
,
getenv
(
"MYSQLTEST_VARDIR"
),
getpid
());
str_to_file
(
buf
,
ds_script
.
str
,
ds_script
.
length
);
/* Create temporary file name */
if
((
fd
=
create_temp_file
(
temp_file_path
,
getenv
(
"MYSQLTEST_VARDIR"
),
"tmp"
,
O_CREAT
|
O_SHARE
|
O_RDWR
,
MYF
(
MY_WME
)))
<
0
)
die
(
"Failed to create temporary file for perl command"
);
my_close
(
fd
,
MYF
(
0
));
str_to_file
(
temp_file_path
,
ds_script
.
str
,
ds_script
.
length
);
/* Format the perl <filename> command */
my_snprintf
(
buf
,
sizeof
(
buf
),
"perl %s/tmp/tmp_%d.pl"
,
getenv
(
"MYSQLTEST_VARDIR"
),
getpid
());
/* Format the "perl <filename>" command */
my_snprintf
(
buf
,
sizeof
(
buf
),
"perl %s"
,
temp_file_path
);
if
(
!
(
res_file
=
popen
(
buf
,
"r"
))
&&
command
->
abort_on_error
)
die
(
"popen(
\"
%s
\"
,
\"
r
\"
) failed"
,
buf
);
...
...
@@ -3002,6 +3030,10 @@ void do_perl(struct st_command *command)
}
}
error
=
pclose
(
res_file
);
/* Remove the temporary file */
my_delete
(
temp_file_path
,
MYF
(
0
));
handle_command_error
(
command
,
WEXITSTATUS
(
error
));
dynstr_free
(
&
ds_script
);
dynstr_free
(
&
ds_delimiter
);
...
...
mysql-test/r/mysqltest.result
View file @
a2f59d74
...
...
@@ -533,6 +533,7 @@ drop table t1;
mysqltest: At line 1: Missing required argument 'filename' to command 'remove_file'
mysqltest: At line 1: Missing required argument 'filename' to command 'write_file'
mysqltest: At line 1: End of file encountered before 'EOF' delimiter was found
Content for test_file1
mysqltest: At line 1: File already exist: 'MYSQLTEST_VARDIR/tmp/test_file1.tmp'
Some data
for cat_file command
...
...
mysql-test/t/mysqltest.test
View file @
a2f59d74
...
...
@@ -1574,6 +1574,7 @@ write_file $MYSQLTEST_VARDIR/tmp/test_file1.tmp;
Content
for
test_file1
EOF
file_exists
$MYSQLTEST_VARDIR
/
tmp
/
test_file1
.
tmp
;
cat_file
$MYSQLTEST_VARDIR
/
tmp
/
test_file1
.
tmp
;
remove_file
$MYSQLTEST_VARDIR
/
tmp
/
test_file1
.
tmp
;
write_file
$MYSQLTEST_VARDIR
/
tmp
/
test_file1
.
tmp
END_DELIMITER
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment