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
62c02d4b
Commit
62c02d4b
authored
Jan 21, 2003
by
bell@sanja.is.com.ua
Browse files
Options
Browse Files
Download
Plain Diff
Merge sanja.is.com.ua:/home/bell/mysql/mysql-4.1
into sanja.is.com.ua:/home/bell/mysql/work-cols-4.1
parents
8aabee29
70dfa422
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
35 additions
and
7 deletions
+35
-7
mysql-test/r/analyse.result
mysql-test/r/analyse.result
+3
-0
mysql-test/r/handler.result
mysql-test/r/handler.result
+2
-0
mysql-test/t/analyse.test
mysql-test/t/analyse.test
+1
-0
mysql-test/t/handler.test
mysql-test/t/handler.test
+2
-0
sql/sql_class.cc
sql/sql_class.cc
+7
-1
sql/sql_derived.cc
sql/sql_derived.cc
+1
-1
sql/sql_select.cc
sql/sql_select.cc
+7
-5
sql/sql_yacc.yy
sql/sql_yacc.yy
+12
-0
No files found.
mysql-test/r/analyse.result
View file @
62c02d4b
drop table if exists t1,t2;
drop table if exists t1,t2;
create table t1 (i int, j int);
create table t1 (i int, j int);
insert into t1 values (1,2), (3,4), (5,6), (7,8);
insert into t1 values (1,2), (3,4), (5,6), (7,8);
select count(*) from t1 procedure analyse();
Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype
-6510615555426900571 -6510615555426900571 -6510615555426900571 -6510615555426900571
select * from t1 procedure analyse();
select * from t1 procedure analyse();
Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype
Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype
t1.i 1 7 1 1 0 0 4.0000 2.2361 ENUM('1','3','5','7') NOT NULL
t1.i 1 7 1 1 0 0 4.0000 2.2361 ENUM('1','3','5','7') NOT NULL
...
...
mysql-test/r/handler.result
View file @
62c02d4b
...
@@ -5,6 +5,8 @@ insert into t1 values
...
@@ -5,6 +5,8 @@ insert into t1 values
(14,"aaa"),(15,"bbb"),(16,"ccc"),(16,"xxx"),
(14,"aaa"),(15,"bbb"),(16,"ccc"),(16,"xxx"),
(20,"ggg"),(21,"hhh"),(22,"iii");
(20,"ggg"),(21,"hhh"),(22,"iii");
handler t1 open as t2;
handler t1 open as t2;
handler t2 read a=(SELECT 1);
You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT 1)' at line 1
handler t2 read a first;
handler t2 read a first;
a b
a b
14 aaa
14 aaa
...
...
mysql-test/t/analyse.test
View file @
62c02d4b
...
@@ -7,6 +7,7 @@ drop table if exists t1,t2;
...
@@ -7,6 +7,7 @@ drop table if exists t1,t2;
--
enable_warnings
--
enable_warnings
create
table
t1
(
i
int
,
j
int
);
create
table
t1
(
i
int
,
j
int
);
insert
into
t1
values
(
1
,
2
),
(
3
,
4
),
(
5
,
6
),
(
7
,
8
);
insert
into
t1
values
(
1
,
2
),
(
3
,
4
),
(
5
,
6
),
(
7
,
8
);
select
count
(
*
)
from
t1
procedure
analyse
();
select
*
from
t1
procedure
analyse
();
select
*
from
t1
procedure
analyse
();
create
table
t2
select
*
from
t1
procedure
analyse
();
create
table
t2
select
*
from
t1
procedure
analyse
();
select
*
from
t2
;
select
*
from
t2
;
...
...
mysql-test/t/handler.test
View file @
62c02d4b
...
@@ -12,6 +12,8 @@ insert into t1 values
...
@@ -12,6 +12,8 @@ insert into t1 values
(
14
,
"aaa"
),(
15
,
"bbb"
),(
16
,
"ccc"
),(
16
,
"xxx"
),
(
14
,
"aaa"
),(
15
,
"bbb"
),(
16
,
"ccc"
),(
16
,
"xxx"
),
(
20
,
"ggg"
),(
21
,
"hhh"
),(
22
,
"iii"
);
(
20
,
"ggg"
),(
21
,
"hhh"
),(
22
,
"iii"
);
handler
t1
open
as
t2
;
handler
t1
open
as
t2
;
--
error
1064
handler
t2
read
a
=
(
SELECT
1
);
handler
t2
read
a
first
;
handler
t2
read
a
first
;
handler
t2
read
a
next
;
handler
t2
read
a
next
;
handler
t2
read
a
next
;
handler
t2
read
a
next
;
...
...
sql/sql_class.cc
View file @
62c02d4b
...
@@ -970,11 +970,12 @@ int select_dumpvar::prepare(List<Item> &list, SELECT_LEX_UNIT *u)
...
@@ -970,11 +970,12 @@ int select_dumpvar::prepare(List<Item> &list, SELECT_LEX_UNIT *u)
my_error
(
ER_WRONG_NUMBER_OF_COLUMNS_IN_SELECT
,
MYF
(
0
));
my_error
(
ER_WRONG_NUMBER_OF_COLUMNS_IN_SELECT
,
MYF
(
0
));
return
1
;
return
1
;
}
}
unit
=
u
;
while
((
item
=
li
++
))
while
((
item
=
li
++
))
{
{
ls
=
gl
++
;
ls
=
gl
++
;
Item_func_set_user_var
*
xx
=
new
Item_func_set_user_var
(
*
ls
,
item
);
Item_func_set_user_var
*
xx
=
new
Item_func_set_user_var
(
*
ls
,
item
);
xx
->
fix_fields
(
current_thd
,(
TABLE_LIST
*
)
current_
thd
->
lex
.
select_lex
.
table_list
.
first
,
&
item
);
xx
->
fix_fields
(
thd
,(
TABLE_LIST
*
)
thd
->
lex
.
select_lex
.
table_list
.
first
,
&
item
);
xx
->
fix_length_and_dec
();
xx
->
fix_length_and_dec
();
vars
.
push_back
(
xx
);
vars
.
push_back
(
xx
);
}
}
...
@@ -986,6 +987,11 @@ bool select_dumpvar::send_data(List<Item> &items)
...
@@ -986,6 +987,11 @@ bool select_dumpvar::send_data(List<Item> &items)
Item_func_set_user_var
*
xx
;
Item_func_set_user_var
*
xx
;
DBUG_ENTER
(
"send_data"
);
DBUG_ENTER
(
"send_data"
);
if
(
unit
->
offset_limit_cnt
)
{
// Using limit offset,count
unit
->
offset_limit_cnt
--
;
DBUG_RETURN
(
0
);
}
if
(
row_count
++
)
if
(
row_count
++
)
{
{
my_error
(
ER_TOO_MANY_ROWS
,
MYF
(
0
));
my_error
(
ER_TOO_MANY_ROWS
,
MYF
(
0
));
...
...
sql/sql_derived.cc
View file @
62c02d4b
...
@@ -25,7 +25,7 @@
...
@@ -25,7 +25,7 @@
#include "sql_select.h"
#include "sql_select.h"
#include "sql_acl.h"
#include "sql_acl.h"
extern
const
char
*
any_db
=
"*any*"
;
// Special symbol for check_access
extern
const
char
*
any_db
;
// Special symbol for check_access
/*
/*
Resolve derived tables in all queries
Resolve derived tables in all queries
...
...
sql/sql_select.cc
View file @
62c02d4b
...
@@ -714,6 +714,13 @@ JOIN::exec()
...
@@ -714,6 +714,13 @@ JOIN::exec()
int
tmp_error
;
int
tmp_error
;
DBUG_ENTER
(
"JOIN::exec"
);
DBUG_ENTER
(
"JOIN::exec"
);
if
(
procedure
)
{
if
(
procedure
->
change_columns
(
fields_list
)
||
result
->
prepare
(
fields_list
,
unit
))
DBUG_VOID_RETURN
;
}
if
(
!
tables_list
)
if
(
!
tables_list
)
{
// Only test of functions
{
// Only test of functions
...
@@ -768,8 +775,6 @@ JOIN::exec()
...
@@ -768,8 +775,6 @@ JOIN::exec()
test_if_skip_sort_order
(
&
join_tab
[
const_tables
],
order
,
test_if_skip_sort_order
(
&
join_tab
[
const_tables
],
order
,
select_limit
,
0
))))
select_limit
,
0
))))
order
=
0
;
order
=
0
;
if
(
procedure
)
(
void
)
result
->
prepare
(
fields_list
,
unit
);
select_describe
(
this
,
need_tmp
,
select_describe
(
this
,
need_tmp
,
order
!=
0
&&
!
skip_sort_order
,
order
!=
0
&&
!
skip_sort_order
,
select_distinct
);
select_distinct
);
...
@@ -989,9 +994,6 @@ JOIN::exec()
...
@@ -989,9 +994,6 @@ JOIN::exec()
}
}
if
(
procedure
)
if
(
procedure
)
{
{
if
(
procedure
->
change_columns
(
fields_list
)
||
result
->
prepare
(
fields_list
,
unit
))
DBUG_VOID_RETURN
;
count_field_types
(
&
tmp_table_param
,
all_fields
,
0
);
count_field_types
(
&
tmp_table_param
,
all_fields
,
0
);
}
}
if
(
group
||
tmp_table_param
.
sum_func_count
||
if
(
group
||
tmp_table_param
.
sum_func_count
||
...
...
sql/sql_yacc.yy
View file @
62c02d4b
...
@@ -2573,6 +2573,12 @@ select_derived:
...
@@ -2573,6 +2573,12 @@ select_derived:
{
{
LEX *lex= Lex;
LEX *lex= Lex;
lex->derived_tables= 1;
lex->derived_tables= 1;
if (((int)lex->sql_command >= (int)SQLCOM_HA_OPEN &&
lex->sql_command <= (int)SQLCOM_HA_READ) || lex->sql_command == (int)SQLCOM_KILL)
{
send_error(lex->thd, ER_SYNTAX_ERROR);
YYABORT;
}
if (lex->current_select->linkage == GLOBAL_OPTIONS_TYPE ||
if (lex->current_select->linkage == GLOBAL_OPTIONS_TYPE ||
mysql_new_select(lex, 1))
mysql_new_select(lex, 1))
YYABORT;
YYABORT;
...
@@ -4643,6 +4649,12 @@ in_subselect_init:
...
@@ -4643,6 +4649,12 @@ in_subselect_init:
subselect_start:
subselect_start:
'(' SELECT_SYM
'(' SELECT_SYM
{
{
LEX *lex=Lex;
if (((int)lex->sql_command >= (int)SQLCOM_HA_OPEN &&
lex->sql_command <= (int)SQLCOM_HA_READ) || lex->sql_command == (int)SQLCOM_KILL) {
send_error(lex->thd, ER_SYNTAX_ERROR);
YYABORT;
}
if (mysql_new_select(Lex, 1))
if (mysql_new_select(Lex, 1))
YYABORT;
YYABORT;
};
};
...
...
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