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
84051f2a
Commit
84051f2a
authored
Aug 08, 2005
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge mysql.com:/home/mydev/mysql-5.0
into mysql.com:/home/mydev/mysql-5.0-5000
parents
9e5c20f3
44b76f17
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
89 additions
and
19 deletions
+89
-19
mysql-test/r/fulltext_order_by.result
mysql-test/r/fulltext_order_by.result
+16
-2
mysql-test/r/group_by.result
mysql-test/r/group_by.result
+7
-0
mysql-test/t/fulltext_order_by.test
mysql-test/t/fulltext_order_by.test
+17
-3
mysql-test/t/group_by.test
mysql-test/t/group_by.test
+11
-1
sql/item_sum.cc
sql/item_sum.cc
+4
-2
sql/item_timefunc.h
sql/item_timefunc.h
+6
-0
sql/mysql_priv.h
sql/mysql_priv.h
+7
-0
sql/sql_derived.cc
sql/sql_derived.cc
+2
-1
sql/sql_select.cc
sql/sql_select.cc
+4
-3
sql/sql_show.cc
sql/sql_show.cc
+2
-1
sql/sql_union.cc
sql/sql_union.cc
+13
-6
No files found.
mysql-test/r/fulltext_order_by.result
View file @
84051f2a
DROP TABLE IF EXISTS t1;
DROP TABLE IF EXISTS t1
,t2,t3
;
CREATE TABLE t1 (
CREATE TABLE t1 (
a INT AUTO_INCREMENT PRIMARY KEY,
a INT AUTO_INCREMENT PRIMARY KEY,
message CHAR(20),
message CHAR(20),
...
@@ -158,5 +158,19 @@ where
...
@@ -158,5 +158,19 @@ where
match(c.beitrag) against ('+abc' in boolean mode)
match(c.beitrag) against ('+abc' in boolean mode)
order by
order by
match(betreff) against ('+abc' in boolean mode) desc;
match(betreff) against ('+abc' in boolean mode) desc;
ERROR HY000: The used table type doesn't support FULLTEXT indexes
text id betreff
(select b.id, b.betreff from t3 b) union
(select b.id, b.betreff from t3 b)
order by match(betreff) against ('+abc' in boolean mode) desc;
id betreff
(select b.id, b.betreff from t3 b) union
(select b.id, b.betreff from t3 b)
order by match(betreff) against ('+abc') desc;
ERROR HY000: Can't find FULLTEXT index matching the column list
select distinct b.id, b.betreff from t3 b
order by match(betreff) against ('+abc' in boolean mode) desc;
id betreff
select b.id, b.betreff from t3 b group by b.id+1
order by match(betreff) against ('+abc' in boolean mode) desc;
id betreff
drop table t1,t2,t3;
drop table t1,t2,t3;
mysql-test/r/group_by.result
View file @
84051f2a
...
@@ -751,6 +751,13 @@ COUNT(DISTINCT(t1.id)) comment
...
@@ -751,6 +751,13 @@ COUNT(DISTINCT(t1.id)) comment
1 NULL
1 NULL
1 a problem
1 a problem
DROP TABLE t1, t2;
DROP TABLE t1, t2;
create table t1 (f1 date);
insert into t1 values('2005-06-06');
insert into t1 values('2005-06-06');
select date(left(f1+0,8)) from t1 group by 1;
date(left(f1+0,8))
2005-06-06
drop table t1;
CREATE TABLE t1 (n int);
CREATE TABLE t1 (n int);
INSERT INTO t1 VALUES (1);
INSERT INTO t1 VALUES (1);
SELECT n+1 AS n FROM t1 GROUP BY n;
SELECT n+1 AS n FROM t1 GROUP BY n;
...
...
mysql-test/t/fulltext_order_by.test
View file @
84051f2a
--
disable_warnings
--
disable_warnings
DROP
TABLE
IF
EXISTS
t1
;
DROP
TABLE
IF
EXISTS
t1
,
t2
,
t3
;
--
enable_warnings
--
enable_warnings
CREATE
TABLE
t1
(
CREATE
TABLE
t1
(
...
@@ -117,8 +117,6 @@ where
...
@@ -117,8 +117,6 @@ where
order
by
order
by
match
(
b
.
betreff
)
against
(
'+abc'
in
boolean
mode
)
desc
;
match
(
b
.
betreff
)
against
(
'+abc'
in
boolean
mode
)
desc
;
--
todo
psergey
:
fix
--
error
1214
select
a
.
text
,
b
.
id
,
b
.
betreff
select
a
.
text
,
b
.
id
,
b
.
betreff
from
from
t2
a
inner
join
t3
b
on
a
.
id
=
b
.
forum
inner
join
t2
a
inner
join
t3
b
on
a
.
id
=
b
.
forum
inner
join
...
@@ -135,6 +133,22 @@ where
...
@@ -135,6 +133,22 @@ where
order
by
order
by
match
(
betreff
)
against
(
'+abc'
in
boolean
mode
)
desc
;
match
(
betreff
)
against
(
'+abc'
in
boolean
mode
)
desc
;
# BUG#11869 part2: used table type doesn't support FULLTEXT indexes error
(
select
b
.
id
,
b
.
betreff
from
t3
b
)
union
(
select
b
.
id
,
b
.
betreff
from
t3
b
)
order
by
match
(
betreff
)
against
(
'+abc'
in
boolean
mode
)
desc
;
--
error
1191
(
select
b
.
id
,
b
.
betreff
from
t3
b
)
union
(
select
b
.
id
,
b
.
betreff
from
t3
b
)
order
by
match
(
betreff
)
against
(
'+abc'
)
desc
;
select
distinct
b
.
id
,
b
.
betreff
from
t3
b
order
by
match
(
betreff
)
against
(
'+abc'
in
boolean
mode
)
desc
;
select
b
.
id
,
b
.
betreff
from
t3
b
group
by
b
.
id
+
1
order
by
match
(
betreff
)
against
(
'+abc'
in
boolean
mode
)
desc
;
drop
table
t1
,
t2
,
t3
;
drop
table
t1
,
t2
,
t3
;
# End of 4.1 tests
# End of 4.1 tests
mysql-test/t/group_by.test
View file @
84051f2a
...
@@ -575,12 +575,22 @@ CREATE TABLE t1 (id varchar(20) NOT NULL);
...
@@ -575,12 +575,22 @@ CREATE TABLE t1 (id varchar(20) NOT NULL);
INSERT
INTO
t1
VALUES
(
'trans1'
),
(
'trans2'
);
INSERT
INTO
t1
VALUES
(
'trans1'
),
(
'trans2'
);
CREATE
TABLE
t2
(
id
varchar
(
20
)
NOT
NULL
,
err_comment
blob
NOT
NULL
);
CREATE
TABLE
t2
(
id
varchar
(
20
)
NOT
NULL
,
err_comment
blob
NOT
NULL
);
INSERT
INTO
t2
VALUES
(
'trans1'
,
'a problem'
);
INSERT
INTO
t2
VALUES
(
'trans1'
,
'a problem'
);
SELECT
COUNT
(
DISTINCT
(
t1
.
id
)),
LEFT
(
err_comment
,
256
)
AS
comment
SELECT
COUNT
(
DISTINCT
(
t1
.
id
)),
LEFT
(
err_comment
,
256
)
AS
comment
FROM
t1
LEFT
JOIN
t2
ON
t1
.
id
=
t2
.
id
GROUP
BY
comment
;
FROM
t1
LEFT
JOIN
t2
ON
t1
.
id
=
t2
.
id
GROUP
BY
comment
;
DROP
TABLE
t1
,
t2
;
DROP
TABLE
t1
,
t2
;
#
# Bug #12266 GROUP BY expression on DATE column produces result with
# reduced length
#
create
table
t1
(
f1
date
);
insert
into
t1
values
(
'2005-06-06'
);
insert
into
t1
values
(
'2005-06-06'
);
select
date
(
left
(
f1
+
0
,
8
))
from
t1
group
by
1
;
drop
table
t1
;
#
#
# Test for bug #11414: crash on Windows for a simple GROUP BY query
# Test for bug #11414: crash on Windows for a simple GROUP BY query
#
#
...
...
sql/item_sum.cc
View file @
84051f2a
...
@@ -2291,7 +2291,8 @@ bool Item_sum_count_distinct::setup(THD *thd)
...
@@ -2291,7 +2291,8 @@ bool Item_sum_count_distinct::setup(THD *thd)
DBUG_ASSERT
(
table
==
0
);
DBUG_ASSERT
(
table
==
0
);
if
(
!
(
table
=
create_tmp_table
(
thd
,
tmp_table_param
,
list
,
(
ORDER
*
)
0
,
1
,
if
(
!
(
table
=
create_tmp_table
(
thd
,
tmp_table_param
,
list
,
(
ORDER
*
)
0
,
1
,
0
,
0
,
select_lex
->
options
|
thd
->
options
,
(
select_lex
->
options
|
thd
->
options
)
&
~
TMP_TABLE_FORCE_MYISAM
,
HA_POS_ERROR
,
(
char
*
)
""
)))
HA_POS_ERROR
,
(
char
*
)
""
)))
return
TRUE
;
return
TRUE
;
table
->
file
->
extra
(
HA_EXTRA_NO_ROWS
);
// Don't update rows
table
->
file
->
extra
(
HA_EXTRA_NO_ROWS
);
// Don't update rows
...
@@ -3073,7 +3074,8 @@ bool Item_func_group_concat::setup(THD *thd)
...
@@ -3073,7 +3074,8 @@ bool Item_func_group_concat::setup(THD *thd)
*/
*/
if
(
!
(
table
=
create_tmp_table
(
thd
,
tmp_table_param
,
all_fields
,
if
(
!
(
table
=
create_tmp_table
(
thd
,
tmp_table_param
,
all_fields
,
(
ORDER
*
)
0
,
0
,
TRUE
,
(
ORDER
*
)
0
,
0
,
TRUE
,
select_lex
->
options
|
thd
->
options
,
(
select_lex
->
options
|
thd
->
options
)
&
~
TMP_TABLE_FORCE_MYISAM
,
HA_POS_ERROR
,
(
char
*
)
""
)))
HA_POS_ERROR
,
(
char
*
)
""
)))
DBUG_RETURN
(
TRUE
);
DBUG_RETURN
(
TRUE
);
table
->
file
->
extra
(
HA_EXTRA_NO_ROWS
);
table
->
file
->
extra
(
HA_EXTRA_NO_ROWS
);
...
...
sql/item_timefunc.h
View file @
84051f2a
...
@@ -714,6 +714,12 @@ class Item_date_typecast :public Item_typecast_maybe_null
...
@@ -714,6 +714,12 @@ class Item_date_typecast :public Item_typecast_maybe_null
{
{
return
(
new
Field_date
(
maybe_null
,
name
,
t_arg
,
&
my_charset_bin
));
return
(
new
Field_date
(
maybe_null
,
name
,
t_arg
,
&
my_charset_bin
));
}
}
void
fix_length_and_dec
()
{
collation
.
set
(
&
my_charset_bin
);
max_length
=
10
;
maybe_null
=
1
;
}
};
};
...
...
sql/mysql_priv.h
View file @
84051f2a
...
@@ -256,6 +256,13 @@ extern CHARSET_INFO *national_charset_info, *table_alias_charset;
...
@@ -256,6 +256,13 @@ extern CHARSET_INFO *national_charset_info, *table_alias_charset;
#define OPTION_WARNINGS (1L << 13) // THD, user
#define OPTION_WARNINGS (1L << 13) // THD, user
#define OPTION_AUTO_IS_NULL (1L << 14) // THD, user, binlog
#define OPTION_AUTO_IS_NULL (1L << 14) // THD, user, binlog
#define OPTION_FOUND_COMMENT (1L << 15) // SELECT, intern, parser
#define OPTION_FOUND_COMMENT (1L << 15) // SELECT, intern, parser
/*
Force the used temporary table to be a MyISAM table (because we will use
fulltext functions when reading from it. This uses the same constant as
OPTION_FOUND_COMMENT because we've run out of bits and these two values
are not used together.
*/
#define TMP_TABLE_FORCE_MYISAM (1L << 15)
#define OPTION_SAFE_UPDATES (1L << 16) // THD, user
#define OPTION_SAFE_UPDATES (1L << 16) // THD, user
#define OPTION_BUFFER_RESULT (1L << 17) // SELECT, user
#define OPTION_BUFFER_RESULT (1L << 17) // SELECT, user
#define OPTION_BIN_LOG (1L << 18) // THD, user
#define OPTION_BIN_LOG (1L << 18) // THD, user
...
...
sql/sql_derived.cc
View file @
84051f2a
...
@@ -142,7 +142,8 @@ int mysql_derived_prepare(THD *thd, LEX *lex, TABLE_LIST *orig_table_list)
...
@@ -142,7 +142,8 @@ int mysql_derived_prepare(THD *thd, LEX *lex, TABLE_LIST *orig_table_list)
unit
->
types
,
(
ORDER
*
)
0
,
unit
->
types
,
(
ORDER
*
)
0
,
FALSE
,
1
,
FALSE
,
1
,
(
first_select
->
options
|
thd
->
options
|
(
first_select
->
options
|
thd
->
options
|
TMP_TABLE_ALL_COLUMNS
),
TMP_TABLE_ALL_COLUMNS
)
&
~
TMP_TABLE_FORCE_MYISAM
,
HA_POS_ERROR
,
HA_POS_ERROR
,
orig_table_list
->
alias
)))
orig_table_list
->
alias
)))
{
{
...
...
sql/sql_select.cc
View file @
84051f2a
...
@@ -1016,7 +1016,7 @@ JOIN::optimize()
...
@@ -1016,7 +1016,7 @@ JOIN::optimize()
group_list
:
(
ORDER
*
)
0
),
group_list
:
(
ORDER
*
)
0
),
group_list
?
0
:
select_distinct
,
group_list
?
0
:
select_distinct
,
group_list
&&
simple_group
,
group_list
&&
simple_group
,
select_options
,
select_options
&
~
TMP_TABLE_FORCE_MYISAM
,
(
order
==
0
||
skip_sort_order
)
?
select_limit
:
(
order
==
0
||
skip_sort_order
)
?
select_limit
:
HA_POS_ERROR
,
HA_POS_ERROR
,
(
char
*
)
""
)))
(
char
*
)
""
)))
...
@@ -1396,7 +1396,8 @@ JOIN::exec()
...
@@ -1396,7 +1396,8 @@ JOIN::exec()
(
ORDER
*
)
0
,
(
ORDER
*
)
0
,
curr_join
->
select_distinct
&&
curr_join
->
select_distinct
&&
!
curr_join
->
group_list
,
!
curr_join
->
group_list
,
1
,
curr_join
->
select_options
,
1
,
curr_join
->
select_options
&
~
TMP_TABLE_FORCE_MYISAM
,
HA_POS_ERROR
,
HA_POS_ERROR
,
(
char
*
)
""
)))
(
char
*
)
""
)))
DBUG_VOID_RETURN
;
DBUG_VOID_RETURN
;
...
@@ -8381,7 +8382,7 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
...
@@ -8381,7 +8382,7 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
/* If result table is small; use a heap */
/* If result table is small; use a heap */
if
(
blob_count
||
using_unique_constraint
||
if
(
blob_count
||
using_unique_constraint
||
(
select_options
&
(
OPTION_BIG_TABLES
|
SELECT_SMALL_RESULT
))
==
(
select_options
&
(
OPTION_BIG_TABLES
|
SELECT_SMALL_RESULT
))
==
OPTION_BIG_TABLES
)
OPTION_BIG_TABLES
||
(
select_options
&
TMP_TABLE_FORCE_MYISAM
)
)
{
{
table
->
file
=
get_new_handler
(
table
,
table
->
s
->
db_type
=
DB_TYPE_MYISAM
);
table
->
file
=
get_new_handler
(
table
,
table
->
s
->
db_type
=
DB_TYPE_MYISAM
);
if
(
group
&&
if
(
group
&&
...
...
sql/sql_show.cc
View file @
84051f2a
...
@@ -3319,7 +3319,8 @@ TABLE *create_schema_table(THD *thd, TABLE_LIST *table_list)
...
@@ -3319,7 +3319,8 @@ TABLE *create_schema_table(THD *thd, TABLE_LIST *table_list)
if
(
!
(
table
=
create_tmp_table
(
thd
,
tmp_table_param
,
if
(
!
(
table
=
create_tmp_table
(
thd
,
tmp_table_param
,
field_list
,
(
ORDER
*
)
0
,
0
,
0
,
field_list
,
(
ORDER
*
)
0
,
0
,
0
,
(
select_lex
->
options
|
thd
->
options
|
(
select_lex
->
options
|
thd
->
options
|
TMP_TABLE_ALL_COLUMNS
),
TMP_TABLE_ALL_COLUMNS
)
&
~
TMP_TABLE_FORCE_MYISAM
,
HA_POS_ERROR
,
table_list
->
alias
)))
HA_POS_ERROR
,
table_list
->
alias
)))
DBUG_RETURN
(
0
);
DBUG_RETURN
(
0
);
table_list
->
schema_table_param
=
tmp_table_param
;
table_list
->
schema_table_param
=
tmp_table_param
;
...
...
sql/sql_union.cc
View file @
84051f2a
...
@@ -119,8 +119,6 @@ void
...
@@ -119,8 +119,6 @@ void
st_select_lex_unit
::
init_prepare_fake_select_lex
(
THD
*
thd
)
st_select_lex_unit
::
init_prepare_fake_select_lex
(
THD
*
thd
)
{
{
thd
->
lex
->
current_select
=
fake_select_lex
;
thd
->
lex
->
current_select
=
fake_select_lex
;
fake_select_lex
->
ftfunc_list_alloc
.
empty
();
fake_select_lex
->
ftfunc_list
=
&
fake_select_lex
->
ftfunc_list_alloc
;
fake_select_lex
->
table_list
.
link_in_list
((
byte
*
)
&
result_table_list
,
fake_select_lex
->
table_list
.
link_in_list
((
byte
*
)
&
result_table_list
,
(
byte
**
)
(
byte
**
)
&
result_table_list
.
next_local
);
&
result_table_list
.
next_local
);
...
@@ -301,15 +299,24 @@ bool st_select_lex_unit::prepare(THD *thd_arg, select_result *sel_result,
...
@@ -301,15 +299,24 @@ bool st_select_lex_unit::prepare(THD *thd_arg, select_result *sel_result,
goto
err
;
goto
err
;
}
}
}
}
ulong
create_options
=
(
first_select_in_union
()
->
options
|
thd_arg
->
options
|
TMP_TABLE_ALL_COLUMNS
)
&
~
TMP_TABLE_FORCE_MYISAM
;
/*
Force the temporary table to be a MyISAM table if we're going to use
fullext functions (MATCH ... AGAINST .. IN BOOLEAN MODE) when reading
from it (this should be removed in 5.2 when fulltext search is moved
out of MyISAM).
*/
if
(
global_parameters
->
ftfunc_list
->
elements
)
create_options
=
create_options
|
TMP_TABLE_FORCE_MYISAM
;
union_result
->
tmp_table_param
.
field_count
=
types
.
elements
;
union_result
->
tmp_table_param
.
field_count
=
types
.
elements
;
if
(
!
(
table
=
create_tmp_table
(
thd_arg
,
if
(
!
(
table
=
create_tmp_table
(
thd_arg
,
&
union_result
->
tmp_table_param
,
types
,
&
union_result
->
tmp_table_param
,
types
,
(
ORDER
*
)
0
,
(
bool
)
union_distinct
,
1
,
(
ORDER
*
)
0
,
(
bool
)
union_distinct
,
1
,
(
first_select_in_union
()
->
options
|
create_options
,
HA_POS_ERROR
,
thd_arg
->
options
|
(
char
*
)
tmp_table_alias
)))
TMP_TABLE_ALL_COLUMNS
),
HA_POS_ERROR
,
(
char
*
)
tmp_table_alias
)))
goto
err
;
goto
err
;
table
->
file
->
extra
(
HA_EXTRA_WRITE_CACHE
);
table
->
file
->
extra
(
HA_EXTRA_WRITE_CACHE
);
table
->
file
->
extra
(
HA_EXTRA_IGNORE_DUP_KEY
);
table
->
file
->
extra
(
HA_EXTRA_IGNORE_DUP_KEY
);
...
...
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