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
48305dcd
Commit
48305dcd
authored
Oct 10, 2004
by
ram@gw.mysql.r18.ru
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
A fix (bug #5382: Server crashes after writing INTO OUTFILE)
parent
5e352def
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
63 additions
and
17 deletions
+63
-17
mysql-test/r/outfile.result
mysql-test/r/outfile.result
+10
-0
mysql-test/t/outfile.test
mysql-test/t/outfile.test
+16
-0
sql/sql_yacc.yy
sql/sql_yacc.yy
+37
-17
No files found.
mysql-test/r/outfile.result
0 → 100644
View file @
48305dcd
drop table if exists t1;
CREATE TABLE t1 (a INT);
EXPLAIN
SELECT *
INTO OUTFILE '/tmp/t1.txt'
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\r\n'
FROM t1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 system NULL NULL NULL NULL 0 const row not found
DROP TABLE t1;
mysql-test/t/outfile.test
View file @
48305dcd
...
@@ -2,6 +2,10 @@
...
@@ -2,6 +2,10 @@
# test of into outfile|dumpfile
# test of into outfile|dumpfile
#
#
--
disable_warnings
drop
table
if
exists
t1
;
--
enable_warnings
# We need to check that we have 'file' privilege.
# We need to check that we have 'file' privilege.
#drop table if exists t1;
#drop table if exists t1;
...
@@ -26,3 +30,15 @@
...
@@ -26,3 +30,15 @@
#INSERT INTO t VALUES ('2002-12-20 12:01:20','',1,"aaa","bbb");
#INSERT INTO t VALUES ('2002-12-20 12:01:20','',1,"aaa","bbb");
#select * from t into outfile "check";
#select * from t into outfile "check";
#drop table if exists t;
#drop table if exists t;
#
# Bug #5382: 'explain select into outfile' crashes the server
#
CREATE
TABLE
t1
(
a
INT
);
EXPLAIN
SELECT
*
INTO
OUTFILE
'/tmp/t1.txt'
FIELDS
TERMINATED
BY
','
OPTIONALLY
ENCLOSED
BY
'"'
LINES
TERMINATED
BY
'\r\n'
FROM
t1
;
DROP
TABLE
t1
;
sql/sql_yacc.yy
View file @
48305dcd
...
@@ -3870,15 +3870,11 @@ select_var_ident: '@' ident_or_text
...
@@ -3870,15 +3870,11 @@ select_var_ident: '@' ident_or_text
into:
into:
INTO OUTFILE TEXT_STRING_sys
INTO OUTFILE TEXT_STRING_sys
{
{
LEX *lex=Lex;
LEX *lex= Lex;
if (!lex->describe)
lex->uncacheable(UNCACHEABLE_SIDEEFFECT);
{
if (!(lex->exchange= new sql_exchange($3.str, 0)) ||
lex->uncacheable(UNCACHEABLE_SIDEEFFECT);
!(lex->result= new select_export(lex->exchange)))
if (!(lex->exchange= new sql_exchange($3.str,0)))
YYABORT;
YYABORT;
if (!(lex->result= new select_export(lex->exchange)))
YYABORT;
}
}
}
opt_field_term opt_line_term
opt_field_term opt_line_term
| INTO DUMPFILE TEXT_STRING_sys
| INTO DUMPFILE TEXT_STRING_sys
...
@@ -4721,15 +4717,28 @@ field_term_list:
...
@@ -4721,15 +4717,28 @@ field_term_list:
| field_term;
| field_term;
field_term:
field_term:
TERMINATED BY text_string { Lex->exchange->field_term= $3;}
TERMINATED BY text_string
{
DBUG_ASSERT(Lex->exchange);
Lex->exchange->field_term= $3;
}
| OPTIONALLY ENCLOSED BY text_string
| OPTIONALLY ENCLOSED BY text_string
{
{
LEX *lex=Lex;
LEX *lex= Lex;
DBUG_ASSERT(lex->exchange);
lex->exchange->enclosed= $4;
lex->exchange->enclosed= $4;
lex->exchange->opt_enclosed=1;
lex->exchange->opt_enclosed=
1;
}
}
| ENCLOSED BY text_string { Lex->exchange->enclosed= $3;}
| ENCLOSED BY text_string
| ESCAPED BY text_string { Lex->exchange->escaped= $3;};
{
DBUG_ASSERT(Lex->exchange);
Lex->exchange->enclosed= $3;
}
| ESCAPED BY text_string
{
DBUG_ASSERT(Lex->exchange);
Lex->exchange->escaped= $3;
};
opt_line_term:
opt_line_term:
/* empty */
/* empty */
...
@@ -4740,13 +4749,24 @@ line_term_list:
...
@@ -4740,13 +4749,24 @@ line_term_list:
| line_term;
| line_term;
line_term:
line_term:
TERMINATED BY text_string { Lex->exchange->line_term= $3;}
TERMINATED BY text_string
| STARTING BY text_string { Lex->exchange->line_start= $3;};
{
DBUG_ASSERT(Lex->exchange);
Lex->exchange->line_term= $3;
}
| STARTING BY text_string
{
DBUG_ASSERT(Lex->exchange);
Lex->exchange->line_start= $3;
};
opt_ignore_lines:
opt_ignore_lines:
/* empty */
/* empty */
| IGNORE_SYM NUM LINES
| IGNORE_SYM NUM LINES
{ Lex->exchange->skip_lines=atol($2.str); };
{
DBUG_ASSERT(Lex->exchange);
Lex->exchange->skip_lines= atol($2.str);
};
/* Common definitions */
/* Common definitions */
...
...
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