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
2c16ccdb
Commit
2c16ccdb
authored
Dec 02, 2003
by
pem@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge mysql.com:/home/pem/work/mysql-4.1
into mysql.com:/home/pem/work/mysql-5.0
parents
e282c8cc
1be4a37f
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
43 additions
and
21 deletions
+43
-21
mysql-test/r/constraints.result
mysql-test/r/constraints.result
+13
-0
mysql-test/t/constraints.test
mysql-test/t/constraints.test
+6
-0
mysql-test/t/rpl000001-slave.opt
mysql-test/t/rpl000001-slave.opt
+1
-0
sql/item.cc
sql/item.cc
+1
-2
sql/sql_prepare.cc
sql/sql_prepare.cc
+4
-6
sql/sql_select.cc
sql/sql_select.cc
+0
-4
sql/sql_yacc.yy
sql/sql_yacc.yy
+18
-9
No files found.
mysql-test/r/constraints.result
View file @
2c16ccdb
...
@@ -14,3 +14,16 @@ drop table t1;
...
@@ -14,3 +14,16 @@ drop table t1;
create table t1 (a int null);
create table t1 (a int null);
insert into t1 values (1),(NULL);
insert into t1 values (1),(NULL);
drop table t1;
drop table t1;
create table t1 (a int null);
alter table t1 add constraint constraint_1 unique (a);
alter table t1 add constraint unique key_1(a);
alter table t1 add constraint constraint_2 unique key_2(a);
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) default NULL,
UNIQUE KEY `constraint_1` (`a`),
UNIQUE KEY `key_1` (`a`),
UNIQUE KEY `key_2` (`a`)
) TYPE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
mysql-test/t/constraints.test
View file @
2c16ccdb
...
@@ -21,3 +21,9 @@ drop table t1;
...
@@ -21,3 +21,9 @@ drop table t1;
create
table
t1
(
a
int
null
);
create
table
t1
(
a
int
null
);
insert
into
t1
values
(
1
),(
NULL
);
insert
into
t1
values
(
1
),(
NULL
);
drop
table
t1
;
drop
table
t1
;
create
table
t1
(
a
int
null
);
alter
table
t1
add
constraint
constraint_1
unique
(
a
);
alter
table
t1
add
constraint
unique
key_1
(
a
);
alter
table
t1
add
constraint
constraint_2
unique
key_2
(
a
);
show
create
table
t1
;
drop
table
t1
;
mysql-test/t/rpl000001-slave.opt
0 → 100644
View file @
2c16ccdb
--innodb
sql/item.cc
View file @
2c16ccdb
...
@@ -599,8 +599,7 @@ int Item_param::save_in_field(Field *field, bool no_conversions)
...
@@ -599,8 +599,7 @@ int Item_param::save_in_field(Field *field, bool no_conversions)
{
{
THD
*
thd
=
current_thd
;
THD
*
thd
=
current_thd
;
if
(
thd
->
command
==
COM_PREPARE
)
DBUG_ASSERT
(
thd
->
command
==
COM_EXECUTE
);
return
-
1
;
if
(
null_value
)
if
(
null_value
)
return
(
int
)
set_field_to_null
(
field
);
return
(
int
)
set_field_to_null
(
field
);
...
...
sql/sql_prepare.cc
View file @
2c16ccdb
...
@@ -672,8 +672,6 @@ static bool mysql_test_select_fields(PREP_STMT *stmt, TABLE_LIST *tables,
...
@@ -672,8 +672,6 @@ static bool mysql_test_select_fields(PREP_STMT *stmt, TABLE_LIST *tables,
fix_tables_pointers
(
thd
->
lex
->
all_selects_list
);
fix_tables_pointers
(
thd
->
lex
->
all_selects_list
);
if
(
!
result
&&
!
(
result
=
new
select_send
()))
if
(
!
result
&&
!
(
result
=
new
select_send
()))
{
{
delete
select_lex
->
having
;
delete
select_lex
->
where
;
send_error
(
thd
,
ER_OUT_OF_RESOURCES
);
send_error
(
thd
,
ER_OUT_OF_RESOURCES
);
DBUG_RETURN
(
1
);
DBUG_RETURN
(
1
);
}
}
...
...
sql/sql_select.cc
View file @
2c16ccdb
...
@@ -1611,10 +1611,6 @@ mysql_select(THD *thd, Item ***rref_pointer_array,
...
@@ -1611,10 +1611,6 @@ mysql_select(THD *thd, Item ***rref_pointer_array,
err:
err:
if
(
free_join
)
if
(
free_join
)
{
{
JOIN
*
curr_join
=
(
join
->
need_tmp
&&
join
->
tmp_join
?
(
join
->
tmp_join
->
error
=
join
->
error
,
join
->
tmp_join
)
:
join
);
thd
->
proc_info
=
"end"
;
thd
->
proc_info
=
"end"
;
err
=
join
->
cleanup
();
err
=
join
->
cleanup
();
if
(
thd
->
net
.
report_error
)
if
(
thd
->
net
.
report_error
)
...
...
sql/sql_yacc.yy
View file @
2c16ccdb
...
@@ -636,7 +636,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize);
...
@@ -636,7 +636,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize);
%type <simple_string>
%type <simple_string>
remember_name remember_end opt_ident opt_db text_or_password
remember_name remember_end opt_ident opt_db text_or_password
opt_escape
opt_escape
opt_constraint
%type <string>
%type <string>
text_string opt_gconcat_separator
text_string opt_gconcat_separator
...
@@ -670,7 +670,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize);
...
@@ -670,7 +670,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize);
ident_list ident_list_arg
ident_list ident_list_arg
%type <key_type>
%type <key_type>
key_type opt_unique_or_fulltext
key_type opt_unique_or_fulltext
constraint_key_type
%type <key_alg>
%type <key_alg>
key_alg opt_btree_or_rtree
key_alg opt_btree_or_rtree
...
@@ -2144,6 +2144,13 @@ key_def:
...
@@ -2144,6 +2144,13 @@ key_def:
lex->key_list.push_back(new Key($1,$2, $3, lex->col_list));
lex->key_list.push_back(new Key($1,$2, $3, lex->col_list));
lex->col_list.empty(); /* Alloced by sql_alloc */
lex->col_list.empty(); /* Alloced by sql_alloc */
}
}
| opt_constraint constraint_key_type opt_ident key_alg '(' key_list ')'
{
LEX *lex=Lex;
const char *key_name= $3 ? $3:$1;
lex->key_list.push_back(new Key($2, key_name, $4, lex->col_list));
lex->col_list.empty(); /* Alloced by sql_alloc */
}
| opt_constraint FOREIGN KEY_SYM opt_ident '(' key_list ')' references
| opt_constraint FOREIGN KEY_SYM opt_ident '(' key_list ')' references
{
{
LEX *lex=Lex;
LEX *lex=Lex;
...
@@ -2167,8 +2174,8 @@ check_constraint:
...
@@ -2167,8 +2174,8 @@ check_constraint:
;
;
opt_constraint:
opt_constraint:
/* empty */
/* empty */
{ $$=(char*) 0; }
| CONSTRAINT opt_ident;
| CONSTRAINT opt_ident
{ $$=$2; }
;
field_spec:
field_spec:
field_ident
field_ident
...
@@ -2530,14 +2537,16 @@ delete_option:
...
@@ -2530,14 +2537,16 @@ delete_option:
| SET DEFAULT { $$= (int) foreign_key::FK_OPTION_DEFAULT; };
| SET DEFAULT { $$= (int) foreign_key::FK_OPTION_DEFAULT; };
key_type:
key_type:
opt_constraint PRIMARY_SYM KEY_SYM { $$= Key::PRIMARY; }
key_or_index { $$= Key::MULTIPLE; }
| key_or_index { $$= Key::MULTIPLE; }
| FULLTEXT_SYM { $$= Key::FULLTEXT; }
| FULLTEXT_SYM { $$= Key::FULLTEXT; }
| FULLTEXT_SYM key_or_index { $$= Key::FULLTEXT; }
| FULLTEXT_SYM key_or_index { $$= Key::FULLTEXT; }
| SPATIAL_SYM { $$= Key::SPATIAL; }
| SPATIAL_SYM { $$= Key::SPATIAL; }
| SPATIAL_SYM key_or_index { $$= Key::SPATIAL; }
| SPATIAL_SYM key_or_index { $$= Key::SPATIAL; };
| opt_constraint UNIQUE_SYM { $$= Key::UNIQUE; }
| opt_constraint UNIQUE_SYM key_or_index { $$= Key::UNIQUE; };
constraint_key_type:
PRIMARY_SYM KEY_SYM { $$= Key::PRIMARY; }
| UNIQUE_SYM { $$= Key::UNIQUE; }
| UNIQUE_SYM key_or_index { $$= Key::UNIQUE; };
key_or_index:
key_or_index:
KEY_SYM {}
KEY_SYM {}
...
...
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