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
2cd53b7a
Commit
2cd53b7a
authored
Nov 28, 2003
by
igor@rurik.mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge rurik.mysql.com:/home/igor/mysql-5.0
into rurik.mysql.com:/home/igor/dev/mysql-5.0-0
parents
1a3a62c3
82270288
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
65 additions
and
20 deletions
+65
-20
include/mysql_com.h
include/mysql_com.h
+2
-1
mysql-test/r/index_merge.result
mysql-test/r/index_merge.result
+5
-0
mysql-test/r/sp-error.result
mysql-test/r/sp-error.result
+11
-0
mysql-test/t/index_merge.test
mysql-test/t/index_merge.test
+4
-0
mysql-test/t/sp-error.test
mysql-test/t/sp-error.test
+21
-0
sql/net_serv.cc
sql/net_serv.cc
+1
-0
sql/opt_range.cc
sql/opt_range.cc
+13
-10
sql/protocol.cc
sql/protocol.cc
+1
-1
sql/sp_rcontext.cc
sql/sp_rcontext.cc
+3
-3
sql/sp_rcontext.h
sql/sp_rcontext.h
+1
-1
sql/sql_yacc.yy
sql/sql_yacc.yy
+3
-4
No files found.
include/mysql_com.h
View file @
2cd53b7a
...
...
@@ -157,7 +157,8 @@ typedef struct st_net {
unsigned
int
*
return_status
;
unsigned
char
reading_or_writing
;
char
save_char
;
my_bool
no_send_ok
;
my_bool
no_send_ok
;
/* For SPs and other things that do multiple stmts */
my_bool
no_send_eof
;
/* For SPs' first version read-only cursors */
/*
Pointer to query object in query cache, do not equal NULL (0) for
queries in cache that have not stored its results yet
...
...
mysql-test/r/index_merge.result
View file @
2cd53b7a
...
...
@@ -270,6 +270,11 @@ explain select * from t0,t1 where t0.key1 = 5 and
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t0 ref i1 i1 4 const 1 Using where
1 SIMPLE t1 index_merge i1,i8 i1,i8 4,4 NULL 2 Using where
explain select * from t0,t1 where t0.key1 < 3 and
(t1.key1 = t0.key1 or t1.key8 = t0.key1);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t0 range i1 i1 4 NULL 3 Using where
1 SIMPLE t1 ALL i1,i8 NULL NULL NULL 1024 Range checked for each record (index map: 0x81)
explain select * from t1 where key1=3 or key2=4
union select * from t1 where key1<4 or key3=5;
id select_type table type possible_keys key key_len ref rows Extra
...
...
mysql-test/r/sp-error.result
View file @
2cd53b7a
...
...
@@ -259,4 +259,15 @@ declare c cursor for select * from t1;
declare c cursor for select field from t1;
end;
ERROR 42000: Duplicate cursor: c
create procedure bug1965()
begin
declare c cursor for select val from t1 order by valname;
open c;
close c;
end;
call bug1965();
ERROR 42S22: Unknown column 'valname' in 'order clause'
drop procedure bug1965;
select 1 into a;
ERROR 42000: Undeclared variable: a
drop table t1;
mysql-test/t/index_merge.test
View file @
2cd53b7a
...
...
@@ -237,6 +237,10 @@ select * from t0,t1 where (t0.key1=t1.key1) and
explain
select
*
from
t0
,
t1
where
t0
.
key1
=
5
and
(
t1
.
key1
=
t0
.
key1
or
t1
.
key8
=
t0
.
key1
);
# Fix for bug#1974
explain
select
*
from
t0
,
t1
where
t0
.
key1
<
3
and
(
t1
.
key1
=
t0
.
key1
or
t1
.
key8
=
t0
.
key1
);
# index_merge inside union
explain
select
*
from
t1
where
key1
=
3
or
key2
=
4
union
select
*
from
t1
where
key1
<
4
or
key3
=
5
;
...
...
mysql-test/t/sp-error.test
View file @
2cd53b7a
...
...
@@ -341,6 +341,27 @@ begin
declare
c
cursor
for
select
field
from
t1
;
end
|
#
# BUG#1965
#
create
procedure
bug1965
()
begin
declare
c
cursor
for
select
val
from
t1
order
by
valname
;
open
c
;
close
c
;
end
|
--
error
1054
call
bug1965
()
|
drop
procedure
bug1965
|
#
# BUG#1966
#
--
error
1308
select
1
into
a
|
drop
table
t1
|
delimiter
;
|
sql/net_serv.cc
View file @
2cd53b7a
...
...
@@ -123,6 +123,7 @@ my_bool my_net_init(NET *net, Vio* vio)
net
->
buff_end
=
net
->
buff
+
net
->
max_packet
;
net
->
vio
=
vio
;
net
->
no_send_ok
=
0
;
net
->
no_send_eof
=
0
;
net
->
error
=
0
;
net
->
return_errno
=
0
;
net
->
return_status
=
0
;
net
->
pkt_nr
=
net
->
compress_pkt_nr
=
0
;
net
->
write_pos
=
net
->
read_pos
=
net
->
buff
;
...
...
sql/opt_range.cc
View file @
2cd53b7a
...
...
@@ -1018,6 +1018,7 @@ int SQL_SELECT::test_quick_select(THD *thd, key_map keys_to_use,
List_iterator_fast
<
SEL_IMERGE
>
it
(
tree
->
merges
);
while
((
imerge
=
it
++
))
{
bool
imerge_failed
=
false
;
double
imerge_cost
=
0
;
ha_rows
imerge_total_records
=
0
;
double
tree_read_time
;
...
...
@@ -1036,21 +1037,23 @@ int SQL_SELECT::test_quick_select(THD *thd, key_map keys_to_use,
&
tree_read_time
,
&
tree_records
,
&
(
imerge
->
best_keys
[
ptree
-
imerge
->
trees
])))
goto
imerge_fail
;
imerge_failed
=
true
;
imerge_cost
+=
tree_read_time
;
imerge_total_records
+=
tree_records
;
}
imerge_total_records
=
min
(
imerge_total_records
,
head
->
file
->
records
);
imerge_cost
+=
imerge_total_records
/
TIME_FOR_COMPARE
;
if
(
imerge_cost
<
min_imerge_cost
)
if
(
!
imerge_failed
)
{
min_imerge
=
imerge
;
min_imerge_cost
=
imerge_cost
;
min_imerge_records
=
imerge_total_records
;
imerge_total_records
=
min
(
imerge_total_records
,
head
->
file
->
records
);
imerge_cost
+=
imerge_total_records
/
TIME_FOR_COMPARE
;
if
(
imerge_cost
<
min_imerge_cost
)
{
min_imerge
=
imerge
;
min_imerge_cost
=
imerge_cost
;
min_imerge_records
=
imerge_total_records
;
}
}
imerge_fail:
;
}
if
(
!
min_imerge
)
...
...
sql/protocol.cc
View file @
2cd53b7a
...
...
@@ -347,7 +347,7 @@ send_eof(THD *thd, bool no_flush)
static
char
eof_buff
[
1
]
=
{
(
char
)
254
};
/* Marker for end of fields */
NET
*
net
=
&
thd
->
net
;
DBUG_ENTER
(
"send_eof"
);
if
(
net
->
vio
!=
0
)
if
(
net
->
vio
!=
0
&&
!
net
->
no_send_eof
)
{
if
(
!
no_flush
&&
(
thd
->
client_capabilities
&
CLIENT_PROTOCOL_41
))
{
...
...
sql/sp_rcontext.cc
View file @
2cd53b7a
...
...
@@ -149,15 +149,15 @@ sp_cursor::pre_open(THD *thd)
m_oprot
=
thd
->
protocol
;
// Save the original protocol
thd
->
protocol
=
m_prot
;
m_
ovio
=
thd
->
net
.
vio
;
// Prevent send_eof()
thd
->
net
.
vio
=
0
;
m_
nseof
=
thd
->
net
.
no_send_eof
;
thd
->
net
.
no_send_eof
=
TRUE
;
return
m_lex
;
}
void
sp_cursor
::
post_open
(
THD
*
thd
,
my_bool
isopen
)
{
thd
->
net
.
vio
=
m_ovio
;
// Restore the originals
thd
->
net
.
no_send_eof
=
m_nseof
;
// Restore the originals
thd
->
protocol
=
m_oprot
;
m_isopen
=
isopen
;
m_current_row
=
m_prot
->
data
;
...
...
sql/sp_rcontext.h
View file @
2cd53b7a
...
...
@@ -240,7 +240,7 @@ private:
LEX
*
m_lex
;
Protocol_cursor
*
m_prot
;
my_bool
m_isopen
;
Vio
*
m_ovio
;
// Original vio
my_bool
m_nseof
;
// Original no_send_eof
Protocol
*
m_oprot
;
// Original protcol
MYSQL_ROWS
*
m_current_row
;
...
...
sql/sql_yacc.yy
View file @
2cd53b7a
...
...
@@ -4555,12 +4555,11 @@ select_var_ident:
| ident_or_text
{
LEX *lex=Lex;
if (!lex->spcont)
YYABORT;
sp_pvar_t *t;
if (!(t=lex->spcont->find_pvar(&$1)))
if (!lex->spcont || !(t=lex->spcont->find_pvar(&$1)))
{
send_error(lex->thd, ER_SP_UNDECLARED_VAR
);
net_printf(YYTHD, ER_SP_UNDECLARED_VAR, $1.str
);
YYABORT;
}
if (! lex->result)
...
...
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