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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
a968d7c2
Commit
a968d7c2
authored
Nov 30, 2002
by
Sinisa@sinisa.nasamreza.org
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
many bug fixes
parent
02c61db6
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
11 additions
and
9 deletions
+11
-9
mysql-test/t/subselect.test
mysql-test/t/subselect.test
+3
-4
sql/item_func.cc
sql/item_func.cc
+2
-2
sql/item_sum.cc
sql/item_sum.cc
+1
-1
sql/item_sum.h
sql/item_sum.h
+1
-1
sql/sql_derived.cc
sql/sql_derived.cc
+3
-0
sql/sql_yacc.yy
sql/sql_yacc.yy
+1
-1
No files found.
mysql-test/t/subselect.test
View file @
a968d7c2
...
@@ -15,12 +15,11 @@ SELECT (SELECT 1), a;
...
@@ -15,12 +15,11 @@ SELECT (SELECT 1), a;
SELECT
1
as
a
FROM
(
SELECT
1
)
as
b
HAVING
(
SELECT
a
)
=
1
;
SELECT
1
as
a
FROM
(
SELECT
1
)
as
b
HAVING
(
SELECT
a
)
=
1
;
--
error
1054
--
error
1054
SELECT
1
FROM
(
SELECT
(
SELECT
a
)
b
)
c
;
SELECT
1
FROM
(
SELECT
(
SELECT
a
)
b
)
c
;
SELECT
1
FROM
(
SELECT
(
SELECT
a
));
SELECT
*
FROM
(
SELECT
1
as
id
)
b
WHERE
id
IN
(
SELECT
*
FROM
(
SELECT
1
as
id
)
c
ORDER
BY
id
LIMIT
1
);
SELECT
*
FROM
(
SELECT
1
as
id
)
WHERE
id
IN
(
SELECT
*
FROM
(
SELECT
1
as
id
)
ORDER
BY
id
LIMIT
1
);
--
error
1239
--
error
1239
SELECT
*
FROM
(
SELECT
1
)
WHERE
1
IN
(
SELECT
1
,
1
);
SELECT
*
FROM
(
SELECT
1
)
a
WHERE
1
IN
(
SELECT
1
,
1
);
SELECT
1
IN
(
SELECT
1
);
SELECT
1
IN
(
SELECT
1
);
SELECT
1
FROM
(
SELECT
1
as
a
)
WHERE
1
IN
(
SELECT
(
SELECT
a
));
SELECT
1
FROM
(
SELECT
1
as
a
)
b
WHERE
1
IN
(
SELECT
(
SELECT
a
));
drop
table
if
exists
t1
,
t2
,
t3
,
t4
,
t5
,
t6
,
t7
,
t8
;
drop
table
if
exists
t1
,
t2
,
t3
,
t4
,
t5
,
t6
,
t7
,
t8
;
create
table
t1
(
a
int
);
create
table
t1
(
a
int
);
create
table
t2
(
a
int
,
b
int
);
create
table
t2
(
a
int
,
b
int
);
...
...
sql/item_func.cc
View file @
a968d7c2
...
@@ -108,8 +108,6 @@ Item_func::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref)
...
@@ -108,8 +108,6 @@ Item_func::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref)
Set return character set to first argument if we are returning a
Set return character set to first argument if we are returning a
string.
string.
*/
*/
if
(
result_type
()
==
STRING_RESULT
)
set_charset
((
*
args
)
->
charset
());
for
(
arg
=
args
,
arg_end
=
args
+
arg_count
;
arg
!=
arg_end
;
arg
++
)
for
(
arg
=
args
,
arg_end
=
args
+
arg_count
;
arg
!=
arg_end
;
arg
++
)
{
{
if
((
*
arg
)
->
check_cols
(
allowed_arg_cols
)
||
if
((
*
arg
)
->
check_cols
(
allowed_arg_cols
)
||
...
@@ -123,6 +121,8 @@ Item_func::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref)
...
@@ -123,6 +121,8 @@ Item_func::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref)
used_tables_cache
|=
(
*
arg
)
->
used_tables
();
used_tables_cache
|=
(
*
arg
)
->
used_tables
();
const_item_cache
&=
(
*
arg
)
->
const_item
();
const_item_cache
&=
(
*
arg
)
->
const_item
();
}
}
if
(
result_type
()
==
STRING_RESULT
)
set_charset
((
*
args
)
->
charset
());
}
}
fix_length_and_dec
();
fix_length_and_dec
();
fixed
=
1
;
fixed
=
1
;
...
...
sql/item_sum.cc
View file @
a968d7c2
...
@@ -41,7 +41,7 @@ Item_sum::Item_sum(List<Item> &list)
...
@@ -41,7 +41,7 @@ Item_sum::Item_sum(List<Item> &list)
list
.
empty
();
// Fields are used
list
.
empty
();
// Fields are used
}
}
void
Item_sum
::
mark_as_sum_func
()
inline
void
Item_sum
::
mark_as_sum_func
()
{
{
current_thd
->
lex
.
current_select
->
with_sum_func
=
with_sum_func
=
1
;
current_thd
->
lex
.
current_select
->
with_sum_func
=
with_sum_func
=
1
;
}
}
...
...
sql/item_sum.h
View file @
a968d7c2
...
@@ -34,6 +34,7 @@ class Item_sum :public Item_result_field
...
@@ -34,6 +34,7 @@ class Item_sum :public Item_result_field
uint
arg_count
;
uint
arg_count
;
bool
quick_group
;
/* If incremental update of fields */
bool
quick_group
;
/* If incremental update of fields */
inline
void
mark_as_sum_func
();
Item_sum
()
:
arg_count
(
0
),
quick_group
(
1
)
Item_sum
()
:
arg_count
(
0
),
quick_group
(
1
)
{
{
mark_as_sum_func
();
mark_as_sum_func
();
...
@@ -54,7 +55,6 @@ class Item_sum :public Item_result_field
...
@@ -54,7 +55,6 @@ class Item_sum :public Item_result_field
}
}
Item_sum
(
List
<
Item
>
&
list
);
Item_sum
(
List
<
Item
>
&
list
);
~
Item_sum
()
{
result_field
=
0
;
}
~
Item_sum
()
{
result_field
=
0
;
}
inline
void
mark_as_sum_func
();
enum
Type
type
()
const
{
return
SUM_FUNC_ITEM
;
}
enum
Type
type
()
const
{
return
SUM_FUNC_ITEM
;
}
virtual
enum
Sumfunctype
sum_func
()
const
=
0
;
virtual
enum
Sumfunctype
sum_func
()
const
=
0
;
...
...
sql/sql_derived.cc
View file @
a968d7c2
...
@@ -107,9 +107,12 @@ int mysql_derived(THD *thd, LEX *lex, SELECT_LEX_UNIT *unit, TABLE_LIST *t)
...
@@ -107,9 +107,12 @@ int mysql_derived(THD *thd, LEX *lex, SELECT_LEX_UNIT *unit, TABLE_LIST *t)
table
->
derived_select_number
=
sl
->
select_number
;
table
->
derived_select_number
=
sl
->
select_number
;
table
->
tmp_table
=
TMP_TABLE
;
table
->
tmp_table
=
TMP_TABLE
;
if
(
lex
->
describe
)
if
(
lex
->
describe
)
tables
->
table_list
->
table
=
tables
->
table
;
// to fix a problem in EXPLAIN
else
sl
->
exclude
();
sl
->
exclude
();
t
->
db
=
(
char
*
)
""
;
t
->
db
=
(
char
*
)
""
;
t
->
derived
=
(
SELECT_LEX
*
)
0
;
// just in case ...
t
->
derived
=
(
SELECT_LEX
*
)
0
;
// just in case ...
table
->
file
->
info
(
HA_STATUS_VARIABLE
);
}
}
}
}
delete
derived_result
;
delete
derived_result
;
...
...
sql/sql_yacc.yy
View file @
a968d7c2
...
@@ -2977,7 +2977,7 @@ insert_values:
...
@@ -2977,7 +2977,7 @@ insert_values:
lex->lock_option= (using_update_log) ? TL_READ_NO_INSERT : TL_READ;
lex->lock_option= (using_update_log) ? TL_READ_NO_INSERT : TL_READ;
mysql_init_select(lex);
mysql_init_select(lex);
}
}
select_options select_item_list select_from select_lock_type
select_options select_item_list
opt_
select_from select_lock_type
union_clause {}
union_clause {}
;
;
...
...
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