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
4fe845e8
Commit
4fe845e8
authored
May 07, 2005
by
antony@ltantony.mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge
parents
b4dcd8f4
a5e95233
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
55 additions
and
4 deletions
+55
-4
mysql-test/r/create.result
mysql-test/r/create.result
+11
-0
mysql-test/r/insert_update.result
mysql-test/r/insert_update.result
+13
-0
mysql-test/t/create.test
mysql-test/t/create.test
+11
-0
mysql-test/t/insert_update.test
mysql-test/t/insert_update.test
+12
-0
ndb/src/kernel/blocks/dbdict/Dbdict.cpp
ndb/src/kernel/blocks/dbdict/Dbdict.cpp
+2
-0
sql/sql_insert.cc
sql/sql_insert.cc
+4
-0
sql/sql_yacc.yy
sql/sql_yacc.yy
+2
-4
No files found.
mysql-test/r/create.result
View file @
4fe845e8
...
@@ -568,3 +568,14 @@ NULL 1
...
@@ -568,3 +568,14 @@ NULL 1
Test 0
Test 0
NULL 1
NULL 1
drop table t1, t2, t3;
drop table t1, t2, t3;
create table t1 (b bool not null default false);
create table t2 (b bool not null default true);
insert into t1 values ();
insert into t2 values ();
select * from t1;
b
0
select * from t2;
b
1
drop table t1,t2;
mysql-test/r/insert_update.result
View file @
4fe845e8
...
@@ -167,3 +167,16 @@ a b c VALUES(a)
...
@@ -167,3 +167,16 @@ a b c VALUES(a)
2 1 11 NULL
2 1 11 NULL
DROP TABLE t1;
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t2;
create table t1 (a int not null unique);
insert into t1 values (1),(2);
insert ignore into t1 select 1 on duplicate key update a=2;
select * from t1;
a
1
2
insert ignore into t1 select a from t1 on duplicate key update a=a+1 ;
select * from t1;
a
1
3
drop table t1;
mysql-test/t/create.test
View file @
4fe845e8
...
@@ -460,3 +460,14 @@ INSERT INTO t2 VALUES ('5000000001', 'proc01', '20031029090650', '2003-10-29 13:
...
@@ -460,3 +460,14 @@ INSERT INTO t2 VALUES ('5000000001', 'proc01', '20031029090650', '2003-10-29 13:
CREATE
TABLE
t3
SELECT
t1
.
dsc
,
COUNT
(
DISTINCT
t2
.
id
)
AS
countOfRuns
FROM
t1
LEFT
JOIN
t2
ON
(
t1
.
id
=
t2
.
id
)
GROUP
BY
t1
.
id
;
CREATE
TABLE
t3
SELECT
t1
.
dsc
,
COUNT
(
DISTINCT
t2
.
id
)
AS
countOfRuns
FROM
t1
LEFT
JOIN
t2
ON
(
t1
.
id
=
t2
.
id
)
GROUP
BY
t1
.
id
;
SELECT
*
FROM
t3
;
SELECT
*
FROM
t3
;
drop
table
t1
,
t2
,
t3
;
drop
table
t1
,
t2
,
t3
;
#
# Bug#9666: Can't use 'DEFAULT FALSE' for column of type bool
#
create
table
t1
(
b
bool
not
null
default
false
);
create
table
t2
(
b
bool
not
null
default
true
);
insert
into
t1
values
();
insert
into
t2
values
();
select
*
from
t1
;
select
*
from
t2
;
drop
table
t1
,
t2
;
mysql-test/t/insert_update.test
View file @
4fe845e8
...
@@ -80,3 +80,15 @@ INSERT t1 SELECT a,b,c FROM t2 WHERE d=2 ON DUPLICATE KEY UPDATE c=c+VALUES(a);
...
@@ -80,3 +80,15 @@ INSERT t1 SELECT a,b,c FROM t2 WHERE d=2 ON DUPLICATE KEY UPDATE c=c+VALUES(a);
SELECT
*
,
VALUES
(
a
)
FROM
t1
;
SELECT
*
,
VALUES
(
a
)
FROM
t1
;
DROP
TABLE
t1
;
DROP
TABLE
t1
;
DROP
TABLE
t2
;
DROP
TABLE
t2
;
#
# Bug#9725 - "disapearing query/hang" and "unknown error" with "on duplicate key update"
# INSERT INGORE...UPDATE gives bad error or breaks protocol.
#
create
table
t1
(
a
int
not
null
unique
);
insert
into
t1
values
(
1
),(
2
);
insert
ignore
into
t1
select
1
on
duplicate
key
update
a
=
2
;
select
*
from
t1
;
insert
ignore
into
t1
select
a
from
t1
on
duplicate
key
update
a
=
a
+
1
;
select
*
from
t1
;
drop
table
t1
;
ndb/src/kernel/blocks/dbdict/Dbdict.cpp
View file @
4fe845e8
...
@@ -4061,12 +4061,14 @@ calcLHbits(Uint32 * lhPageBits, Uint32 * lhDistrBits,
...
@@ -4061,12 +4061,14 @@ calcLHbits(Uint32 * lhPageBits, Uint32 * lhDistrBits,
tmp
<<=
1
;
tmp
<<=
1
;
distrBits
++
;
distrBits
++
;
}
//while
}
//while
#ifdef ndb_classical_lhdistrbits
if
(
tmp
!=
totalFragments
)
{
if
(
tmp
!=
totalFragments
)
{
tmp
>>=
1
;
tmp
>>=
1
;
if
((
fid
>=
(
totalFragments
-
tmp
))
&&
(
fid
<
(
tmp
-
1
)))
{
if
((
fid
>=
(
totalFragments
-
tmp
))
&&
(
fid
<
(
tmp
-
1
)))
{
distrBits
--
;
distrBits
--
;
}
//if
}
//if
}
//if
}
//if
#endif
*
lhPageBits
=
pageBits
;
*
lhPageBits
=
pageBits
;
*
lhDistrBits
=
distrBits
;
*
lhDistrBits
=
distrBits
;
...
...
sql/sql_insert.cc
View file @
4fe845e8
...
@@ -897,7 +897,11 @@ int write_record(THD *thd, TABLE *table,COPY_INFO *info)
...
@@ -897,7 +897,11 @@ int write_record(THD *thd, TABLE *table,COPY_INFO *info)
goto
err
;
goto
err
;
if
((
error
=
table
->
file
->
update_row
(
table
->
record
[
1
],
table
->
record
[
0
])))
if
((
error
=
table
->
file
->
update_row
(
table
->
record
[
1
],
table
->
record
[
0
])))
{
if
((
error
==
HA_ERR_FOUND_DUPP_KEY
)
&&
info
->
ignore
)
break
;
goto
err
;
goto
err
;
}
info
->
updated
++
;
info
->
updated
++
;
break
;
break
;
}
}
...
...
sql/sql_yacc.yy
View file @
4fe845e8
...
@@ -4458,8 +4458,6 @@ simple_expr:
...
@@ -4458,8 +4458,6 @@ simple_expr:
{ $$= new Item_func_export_set($3, $5, $7, $9); }
{ $$= new Item_func_export_set($3, $5, $7, $9); }
| EXPORT_SET '(' expr ',' expr ',' expr ',' expr ',' expr ')'
| EXPORT_SET '(' expr ',' expr ',' expr ',' expr ',' expr ')'
{ $$= new Item_func_export_set($3, $5, $7, $9, $11); }
{ $$= new Item_func_export_set($3, $5, $7, $9, $11); }
| FALSE_SYM
{ $$= new Item_int((char*) "FALSE",0,1); }
| FORMAT_SYM '(' expr ',' NUM ')'
| FORMAT_SYM '(' expr ',' NUM ')'
{ $$= new Item_func_format($3,atoi($5.str)); }
{ $$= new Item_func_format($3,atoi($5.str)); }
| FROM_UNIXTIME '(' expr ')'
| FROM_UNIXTIME '(' expr ')'
...
@@ -4618,8 +4616,6 @@ simple_expr:
...
@@ -4618,8 +4616,6 @@ simple_expr:
{ $$= new Item_func_trim($5,$3); }
{ $$= new Item_func_trim($5,$3); }
| TRUNCATE_SYM '(' expr ',' expr ')'
| TRUNCATE_SYM '(' expr ',' expr ')'
{ $$= new Item_func_round($3,$5,1); }
{ $$= new Item_func_round($3,$5,1); }
| TRUE_SYM
{ $$= new Item_int((char*) "TRUE",1,1); }
| ident '.' ident '(' udf_expr_list ')'
| ident '.' ident '(' udf_expr_list ')'
{
{
LEX *lex= Lex;
LEX *lex= Lex;
...
@@ -6834,6 +6830,8 @@ literal:
...
@@ -6834,6 +6830,8 @@ literal:
| NUM_literal { $$ = $1; }
| NUM_literal { $$ = $1; }
| NULL_SYM { $$ = new Item_null();
| NULL_SYM { $$ = new Item_null();
Lex->next_state=MY_LEX_OPERATOR_OR_IDENT;}
Lex->next_state=MY_LEX_OPERATOR_OR_IDENT;}
| FALSE_SYM { $$= new Item_int((char*) "FALSE",0,1); }
| TRUE_SYM { $$= new Item_int((char*) "TRUE",1,1); }
| HEX_NUM { $$ = new Item_hex_string($1.str, $1.length);}
| HEX_NUM { $$ = new Item_hex_string($1.str, $1.length);}
| BIN_NUM { $$= new Item_bin_string($1.str, $1.length); }
| BIN_NUM { $$= new Item_bin_string($1.str, $1.length); }
| UNDERSCORE_CHARSET HEX_NUM
| UNDERSCORE_CHARSET HEX_NUM
...
...
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