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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
9f687c35
Commit
9f687c35
authored
Sep 23, 2005
by
stewart@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge ssmith@bk-internal.mysql.com:/home/bk/mysql-4.1
into mysql.com:/home/stewart/Documents/MySQL/4.1/main
parents
0a37d077
4700631a
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
62 additions
and
4 deletions
+62
-4
client/mysqltest.c
client/mysqltest.c
+1
-0
mysql-test/r/loaddata.result
mysql-test/r/loaddata.result
+10
-0
mysql-test/t/loaddata.test
mysql-test/t/loaddata.test
+27
-0
sql/sql_load.cc
sql/sql_load.cc
+4
-0
sql/sql_yacc.yy
sql/sql_yacc.yy
+20
-4
No files found.
client/mysqltest.c
View file @
9f687c35
...
...
@@ -3914,6 +3914,7 @@ int main(int argc, char **argv)
error
|=
run_query
(
&
cur_con
->
mysql
,
q
,
QUERY_REAP
|
QUERY_SEND
);
display_result_vertically
=
old_display_result_vertically
;
q
->
last_argument
=
q
->
end
;
query_executed
=
1
;
break
;
}
case
Q_QUERY
:
...
...
mysql-test/r/loaddata.result
View file @
9f687c35
...
...
@@ -66,3 +66,13 @@ a b
3 row 3
0
drop table t1;
SET @OLD_SQL_MODE=@@SQL_MODE, @@SQL_MODE=NO_AUTO_VALUE_ON_ZERO;
create table t1(id integer not null auto_increment primary key);
insert into t1 values(0);
select * from t1;
id
0
select * from t1;
id
0
SET @@SQL_MODE=@OLD_SQL_MODE;
mysql-test/t/loaddata.test
View file @
9f687c35
...
...
@@ -31,4 +31,31 @@ load data infile '../../std_data/loaddata4.dat' into table t1 fields terminated
select
*
from
t1
;
drop
table
t1
;
#
# Bug #12053 LOAD DATA INFILE ignores NO_AUTO_VALUE_ON_ZERO setting
#
SET
@
OLD_SQL_MODE
=@@
SQL_MODE
,
@@
SQL_MODE
=
NO_AUTO_VALUE_ON_ZERO
;
create
table
t1
(
id
integer
not
null
auto_increment
primary
key
);
insert
into
t1
values
(
0
);
disable_query_log
;
eval
SELECT
*
INTO
OUTFILE
'$MYSQL_TEST_DIR/var/tmp/t1'
from
t1
;
delete
from
t1
;
eval
load
data
infile
'$MYSQL_TEST_DIR/var/tmp/t1'
into
table
t1
;
enable_query_log
;
select
*
from
t1
;
--
exec
rm
$MYSQL_TEST_DIR
/
var
/
tmp
/
t1
disable_query_log
;
eval
SELECT
*
INTO
OUTFILE
'$MYSQL_TEST_DIR/var/tmp/t1'
FIELDS
TERMINATED
BY
''
OPTIONALLY
ENCLOSED
BY
''
LINES
TERMINATED
BY
'\r\n'
FROM
t1
;
delete
from
t1
;
eval
load
data
infile
'$MYSQL_TEST_DIR/var/tmp/t1'
into
table
t1
FIELDS
TERMINATED
BY
''
OPTIONALLY
ENCLOSED
BY
''
LINES
TERMINATED
BY
'\r\n'
;
enable_query_log
;
select
*
from
t1
;
--
exec
rm
$MYSQL_TEST_DIR
/
var
/
tmp
/
t1
SET
@@
SQL_MODE
=@
OLD_SQL_MODE
;
# End of 4.1 tests
sql/sql_load.cc
View file @
9f687c35
...
...
@@ -429,6 +429,8 @@ read_fixed_length(THD *thd,COPY_INFO &info,TABLE *table,List<Item> &fields,
while
((
sql_field
=
(
Item_field
*
)
it
++
))
{
Field
*
field
=
sql_field
->
field
;
if
(
field
==
table
->
next_number_field
)
table
->
auto_increment_field_not_null
=
TRUE
;
if
(
pos
==
read_info
.
row_end
)
{
thd
->
cuted_fields
++
;
/* Not enough fields */
...
...
@@ -520,6 +522,8 @@ read_sep_field(THD *thd,COPY_INFO &info,TABLE *table,
length
=
(
uint
)
(
read_info
.
row_end
-
pos
);
Field
*
field
=
sql_field
->
field
;
if
(
field
==
table
->
next_number_field
)
table
->
auto_increment_field_not_null
=
TRUE
;
if
(
!
read_info
.
enclosed
&&
(
enclosed_length
&&
length
==
4
&&
!
memcmp
(
pos
,
"NULL"
,
4
))
||
(
length
==
1
&&
read_info
.
found_null
))
...
...
sql/sql_yacc.yy
View file @
9f687c35
...
...
@@ -644,7 +644,8 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
NUM_literal
%type <item_list>
expr_list udf_expr_list when_list ident_list ident_list_arg
expr_list udf_expr_list udf_sum_expr_list when_list ident_list
ident_list_arg
%type <key_type>
key_type opt_unique_or_fulltext constraint_key_type
...
...
@@ -3137,21 +3138,21 @@ simple_expr:
{ $$= new Item_func_trim($5,$3); }
| TRUNCATE_SYM '(' expr ',' expr ')'
{ $$= new Item_func_round($3,$5,1); }
| UDA_CHAR_SUM '(' udf_expr_list ')'
| UDA_CHAR_SUM '(' udf_
sum_
expr_list ')'
{
if ($3 != NULL)
$$ = new Item_sum_udf_str($1, *$3);
else
$$ = new Item_sum_udf_str($1);
}
| UDA_FLOAT_SUM '(' udf_expr_list ')'
| UDA_FLOAT_SUM '(' udf_
sum_
expr_list ')'
{
if ($3 != NULL)
$$ = new Item_sum_udf_float($1, *$3);
else
$$ = new Item_sum_udf_float($1);
}
| UDA_INT_SUM '(' udf_expr_list ')'
| UDA_INT_SUM '(' udf_
sum_
expr_list ')'
{
if ($3 != NULL)
$$ = new Item_sum_udf_int($1, *$3);
...
...
@@ -3289,6 +3290,21 @@ udf_expr_list:
/* empty */ { $$= NULL; }
| expr_list { $$= $1;};
udf_sum_expr_list:
{
LEX *lex= Lex;
if (lex->current_select->inc_in_sum_expr())
{
yyerror(ER(ER_SYNTAX_ERROR));
YYABORT;
}
}
udf_expr_list
{
Select->in_sum_expr--;
$$= $2;
};
sum_expr:
AVG_SYM '(' in_sum_expr ')'
{ $$=new Item_sum_avg($3); }
...
...
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