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
0612a212
Commit
0612a212
authored
Oct 20, 2006
by
gkodinov@dl145s.mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge bk-internal:/home/bk/mysql-4.1
into dl145s.mysql.com:/data/bk/team_tree_merge/MERGE/mysql-4.1-opt
parents
d2fa9fd1
1dacdd4c
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
143 additions
and
9 deletions
+143
-9
myisam/mi_range.c
myisam/mi_range.c
+15
-0
mysql-test/r/func_gconcat.result
mysql-test/r/func_gconcat.result
+0
-5
mysql-test/r/gis-rtree.result
mysql-test/r/gis-rtree.result
+11
-0
mysql-test/r/group_by.result
mysql-test/r/group_by.result
+45
-0
mysql-test/r/olap.result
mysql-test/r/olap.result
+15
-0
mysql-test/t/func_gconcat.test
mysql-test/t/func_gconcat.test
+0
-1
mysql-test/t/gis-rtree.test
mysql-test/t/gis-rtree.test
+10
-0
mysql-test/t/group_by.test
mysql-test/t/group_by.test
+23
-0
mysql-test/t/olap.test
mysql-test/t/olap.test
+9
-0
sql/sql_base.cc
sql/sql_base.cc
+9
-2
sql/sql_select.cc
sql/sql_select.cc
+6
-1
No files found.
myisam/mi_range.c
View file @
0612a212
...
@@ -71,6 +71,21 @@ ha_rows mi_records_in_range(MI_INFO *info, int inx, key_range *min_key,
...
@@ -71,6 +71,21 @@ ha_rows mi_records_in_range(MI_INFO *info, int inx, key_range *min_key,
uchar
*
key_buff
;
uchar
*
key_buff
;
uint
start_key_len
;
uint
start_key_len
;
/*
The problem is that the optimizer doesn't support
RTree keys properly at the moment.
Hope this will be fixed some day.
But now NULL in the min_key means that we
didn't make the task for the RTree key
and expect BTree functionality from it.
As it's not able to handle such request
we return the error.
*/
if
(
!
min_key
)
{
res
=
HA_POS_ERROR
;
break
;
}
key_buff
=
info
->
lastkey
+
info
->
s
->
base
.
max_key_length
;
key_buff
=
info
->
lastkey
+
info
->
s
->
base
.
max_key_length
;
start_key_len
=
_mi_pack_key
(
info
,
inx
,
key_buff
,
start_key_len
=
_mi_pack_key
(
info
,
inx
,
key_buff
,
(
uchar
*
)
min_key
->
key
,
min_key
->
length
,
(
uchar
*
)
min_key
->
key
,
min_key
->
length
,
...
...
mysql-test/r/func_gconcat.result
View file @
0612a212
...
@@ -74,11 +74,6 @@ grp group_concat(c order by 1)
...
@@ -74,11 +74,6 @@ grp group_concat(c order by 1)
1 a
1 a
2 b,c
2 b,c
3 C,D,d,d,D,E
3 C,D,d,d,D,E
select grp,group_concat(c order by "c") from t1 group by grp;
grp group_concat(c order by "c")
1 a
2 b,c
3 C,D,d,d,D,E
select grp,group_concat(distinct c order by c) from t1 group by grp;
select grp,group_concat(distinct c order by c) from t1 group by grp;
grp group_concat(distinct c order by c)
grp group_concat(distinct c order by c)
1 a
1 a
...
...
mysql-test/r/gis-rtree.result
View file @
0612a212
...
@@ -857,3 +857,14 @@ CHECK TABLE t1 EXTENDED;
...
@@ -857,3 +857,14 @@ CHECK TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
Table Op Msg_type Msg_text
test.t1 check status OK
test.t1 check status OK
DROP TABLE t1;
DROP TABLE t1;
CREATE TABLE t1 (foo GEOMETRY NOT NULL, SPATIAL INDEX(foo) );
INSERT INTO t1 (foo) VALUES (PointFromWKB(POINT(1,1)));
INSERT INTO t1 (foo) VALUES (PointFromWKB(POINT(1,0)));
INSERT INTO t1 (foo) VALUES (PointFromWKB(POINT(0,1)));
INSERT INTO t1 (foo) VALUES (PointFromWKB(POINT(0,0)));
SELECT 1 FROM t1 WHERE foo != PointFromWKB(POINT(0,0));
1
1
1
1
DROP TABLE t1;
mysql-test/r/group_by.result
View file @
0612a212
...
@@ -773,3 +773,48 @@ select sql_buffer_result max(f1)+1 from t1;
...
@@ -773,3 +773,48 @@ select sql_buffer_result max(f1)+1 from t1;
max(f1)+1
max(f1)+1
3
3
drop table t1;
drop table t1;
CREATE TABLE t1(a INT);
INSERT INTO t1 VALUES (1),(2);
SELECT a FROM t1 GROUP BY 'a';
a
1
SELECT a FROM t1 GROUP BY "a";
a
1
SELECT a FROM t1 GROUP BY `a`;
a
1
2
set sql_mode=ANSI_QUOTES;
SELECT a FROM t1 GROUP BY "a";
a
1
2
SELECT a FROM t1 GROUP BY 'a';
a
1
SELECT a FROM t1 GROUP BY `a`;
a
1
2
set sql_mode='';
SELECT a FROM t1 HAVING 'a' > 1;
a
SELECT a FROM t1 HAVING "a" > 1;
a
SELECT a FROM t1 HAVING `a` > 1;
a
2
SELECT a FROM t1 ORDER BY 'a' DESC;
a
1
2
SELECT a FROM t1 ORDER BY "a" DESC;
a
1
2
SELECT a FROM t1 ORDER BY `a` DESC;
a
2
1
DROP TABLE t1;
mysql-test/r/olap.result
View file @
0612a212
...
@@ -541,3 +541,18 @@ a max(b)
...
@@ -541,3 +541,18 @@ a max(b)
NULL 2
NULL 2
a 1
a 1
drop table t1;
drop table t1;
create table t1 (a varchar(22) not null , b int);
insert into t1 values ("2006-07-01 21:30", 1), ("2006-07-01 23:30", 10);
select left(a,10), a, sum(b) from t1 group by 1,2 with rollup;
left(a,10) a sum(b)
2006-07-01 2006-07-01 21:30 1
2006-07-01 2006-07-01 23:30 10
2006-07-01 NULL 11
NULL NULL 11
select left(a,10) x, a, sum(b) from t1 group by x,a with rollup;
x a sum(b)
2006-07-01 2006-07-01 21:30 1
2006-07-01 2006-07-01 23:30 10
2006-07-01 NULL 11
NULL NULL 11
drop table t1;
mysql-test/t/func_gconcat.test
View file @
0612a212
...
@@ -32,7 +32,6 @@ select grp,group_concat(d order by a desc) from t1 group by grp;
...
@@ -32,7 +32,6 @@ select grp,group_concat(d order by a desc) from t1 group by grp;
select
grp
,
group_concat
(
a
order
by
a
,
d
+
c
-
ascii
(
c
)
-
a
)
from
t1
group
by
grp
;
select
grp
,
group_concat
(
a
order
by
a
,
d
+
c
-
ascii
(
c
)
-
a
)
from
t1
group
by
grp
;
select
grp
,
group_concat
(
a
order
by
d
+
c
-
ascii
(
c
),
a
)
from
t1
group
by
grp
;
select
grp
,
group_concat
(
a
order
by
d
+
c
-
ascii
(
c
),
a
)
from
t1
group
by
grp
;
select
grp
,
group_concat
(
c
order
by
1
)
from
t1
group
by
grp
;
select
grp
,
group_concat
(
c
order
by
1
)
from
t1
group
by
grp
;
select
grp
,
group_concat
(
c
order
by
"c"
)
from
t1
group
by
grp
;
select
grp
,
group_concat
(
distinct
c
order
by
c
)
from
t1
group
by
grp
;
select
grp
,
group_concat
(
distinct
c
order
by
c
)
from
t1
group
by
grp
;
select
grp
,
group_concat
(
distinct
c
order
by
c
desc
)
from
t1
group
by
grp
;
select
grp
,
group_concat
(
distinct
c
order
by
c
desc
)
from
t1
group
by
grp
;
explain
extended
select
grp
,
group_concat
(
distinct
c
order
by
c
desc
)
from
t1
group
by
grp
;
explain
extended
select
grp
,
group_concat
(
distinct
c
order
by
c
desc
)
from
t1
group
by
grp
;
...
...
mysql-test/t/gis-rtree.test
View file @
0612a212
...
@@ -232,4 +232,14 @@ INSERT INTO t1 (c1) VALUES (
...
@@ -232,4 +232,14 @@ INSERT INTO t1 (c1) VALUES (
CHECK
TABLE
t1
EXTENDED
;
CHECK
TABLE
t1
EXTENDED
;
DROP
TABLE
t1
;
DROP
TABLE
t1
;
#
# Bug #21888: Query on GEOMETRY field using PointFromWKB() results in lost connection
#
CREATE
TABLE
t1
(
foo
GEOMETRY
NOT
NULL
,
SPATIAL
INDEX
(
foo
)
);
INSERT
INTO
t1
(
foo
)
VALUES
(
PointFromWKB
(
POINT
(
1
,
1
)));
INSERT
INTO
t1
(
foo
)
VALUES
(
PointFromWKB
(
POINT
(
1
,
0
)));
INSERT
INTO
t1
(
foo
)
VALUES
(
PointFromWKB
(
POINT
(
0
,
1
)));
INSERT
INTO
t1
(
foo
)
VALUES
(
PointFromWKB
(
POINT
(
0
,
0
)));
SELECT
1
FROM
t1
WHERE
foo
!=
PointFromWKB
(
POINT
(
0
,
0
));
DROP
TABLE
t1
;
# End of 4.1 tests
# End of 4.1 tests
mysql-test/t/group_by.test
View file @
0612a212
...
@@ -610,4 +610,27 @@ select sql_buffer_result max(f1) is null from t1;
...
@@ -610,4 +610,27 @@ select sql_buffer_result max(f1) is null from t1;
select
sql_buffer_result
max
(
f1
)
+
1
from
t1
;
select
sql_buffer_result
max
(
f1
)
+
1
from
t1
;
drop
table
t1
;
drop
table
t1
;
#
# BUG#14019-4.1-opt
#
CREATE
TABLE
t1
(
a
INT
);
INSERT
INTO
t1
VALUES
(
1
),(
2
);
SELECT
a
FROM
t1
GROUP
BY
'a'
;
SELECT
a
FROM
t1
GROUP
BY
"a"
;
SELECT
a
FROM
t1
GROUP
BY
`a`
;
set
sql_mode
=
ANSI_QUOTES
;
SELECT
a
FROM
t1
GROUP
BY
"a"
;
SELECT
a
FROM
t1
GROUP
BY
'a'
;
SELECT
a
FROM
t1
GROUP
BY
`a`
;
set
sql_mode
=
''
;
SELECT
a
FROM
t1
HAVING
'a'
>
1
;
SELECT
a
FROM
t1
HAVING
"a"
>
1
;
SELECT
a
FROM
t1
HAVING
`a`
>
1
;
SELECT
a
FROM
t1
ORDER
BY
'a'
DESC
;
SELECT
a
FROM
t1
ORDER
BY
"a"
DESC
;
SELECT
a
FROM
t1
ORDER
BY
`a`
DESC
;
DROP
TABLE
t1
;
# End of 4.1 tests
# End of 4.1 tests
mysql-test/t/olap.test
View file @
0612a212
...
@@ -272,4 +272,13 @@ select a, max(b) from t1 group by a with rollup;
...
@@ -272,4 +272,13 @@ select a, max(b) from t1 group by a with rollup;
select
distinct
a
,
max
(
b
)
from
t1
group
by
a
with
rollup
;
select
distinct
a
,
max
(
b
)
from
t1
group
by
a
with
rollup
;
drop
table
t1
;
drop
table
t1
;
#
# Bug #20825: rollup puts non-equal values together
#
create
table
t1
(
a
varchar
(
22
)
not
null
,
b
int
);
insert
into
t1
values
(
"2006-07-01 21:30"
,
1
),
(
"2006-07-01 23:30"
,
10
);
select
left
(
a
,
10
),
a
,
sum
(
b
)
from
t1
group
by
1
,
2
with
rollup
;
select
left
(
a
,
10
)
x
,
a
,
sum
(
b
)
from
t1
group
by
x
,
a
with
rollup
;
drop
table
t1
;
# End of 4.1 tests
# End of 4.1 tests
sql/sql_base.cc
View file @
0612a212
...
@@ -2284,12 +2284,19 @@ find_item_in_list(Item *find, List<Item> &items, uint *counter,
...
@@ -2284,12 +2284,19 @@ find_item_in_list(Item *find, List<Item> &items, uint *counter,
const
char
*
field_name
=
0
;
const
char
*
field_name
=
0
;
const
char
*
table_name
=
0
;
const
char
*
table_name
=
0
;
bool
found_unaliased_non_uniq
=
0
;
bool
found_unaliased_non_uniq
=
0
;
/*
true if the item that we search for is a valid name reference
(and not an item that happens to have a name).
*/
bool
is_ref_by_name
=
0
;
uint
unaliased_counter
;
uint
unaliased_counter
;
LINT_INIT
(
unaliased_counter
);
LINT_INIT
(
unaliased_counter
);
*
unaliased
=
FALSE
;
*
unaliased
=
FALSE
;
if
(
find
->
type
()
==
Item
::
FIELD_ITEM
||
find
->
type
()
==
Item
::
REF_ITEM
)
is_ref_by_name
=
(
find
->
type
()
==
Item
::
FIELD_ITEM
||
find
->
type
()
==
Item
::
REF_ITEM
);
if
(
is_ref_by_name
)
{
{
field_name
=
((
Item_ident
*
)
find
)
->
field_name
;
field_name
=
((
Item_ident
*
)
find
)
->
field_name
;
table_name
=
((
Item_ident
*
)
find
)
->
table_name
;
table_name
=
((
Item_ident
*
)
find
)
->
table_name
;
...
@@ -2401,7 +2408,7 @@ find_item_in_list(Item *find, List<Item> &items, uint *counter,
...
@@ -2401,7 +2408,7 @@ find_item_in_list(Item *find, List<Item> &items, uint *counter,
}
}
}
}
else
if
(
!
table_name
&&
(
item
->
eq
(
find
,
0
)
||
else
if
(
!
table_name
&&
(
item
->
eq
(
find
,
0
)
||
find
->
name
&&
item
->
name
&&
is_ref_by_name
&&
find
->
name
&&
item
->
name
&&
!
my_strcasecmp
(
system_charset_info
,
!
my_strcasecmp
(
system_charset_info
,
item
->
name
,
find
->
name
)))
item
->
name
,
find
->
name
)))
{
{
...
...
sql/sql_select.cc
View file @
0612a212
...
@@ -9723,12 +9723,17 @@ bool JOIN::rollup_init()
...
@@ -9723,12 +9723,17 @@ bool JOIN::rollup_init()
while
((
item
=
it
++
))
while
((
item
=
it
++
))
{
{
ORDER
*
group_tmp
;
ORDER
*
group_tmp
;
bool
found_in_group
=
0
;
for
(
group_tmp
=
group_list
;
group_tmp
;
group_tmp
=
group_tmp
->
next
)
for
(
group_tmp
=
group_list
;
group_tmp
;
group_tmp
=
group_tmp
->
next
)
{
{
if
(
*
group_tmp
->
item
==
item
)
if
(
*
group_tmp
->
item
==
item
)
{
item
->
maybe_null
=
1
;
item
->
maybe_null
=
1
;
found_in_group
=
1
;
}
}
}
if
(
item
->
type
()
==
Item
::
FUNC_ITEM
)
if
(
item
->
type
()
==
Item
::
FUNC_ITEM
&&
!
found_in_group
)
{
{
bool
changed
=
FALSE
;
bool
changed
=
FALSE
;
if
(
change_group_ref
(
thd
,
(
Item_func
*
)
item
,
group_list
,
&
changed
))
if
(
change_group_ref
(
thd
,
(
Item_func
*
)
item
,
group_list
,
&
changed
))
...
...
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