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
fbe27ca4
Commit
fbe27ca4
authored
Nov 25, 2007
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge stella.local:/home2/mydev/mysql-5.1-ateam
into stella.local:/home2/mydev/mysql-5.1-axmrg
parents
4b20fc0f
a41eb645
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
116 additions
and
16 deletions
+116
-16
mysql-test/r/func_set.result
mysql-test/r/func_set.result
+30
-0
mysql-test/r/olap.result
mysql-test/r/olap.result
+8
-0
mysql-test/r/xml.result
mysql-test/r/xml.result
+7
-0
mysql-test/t/func_set.test
mysql-test/t/func_set.test
+18
-1
mysql-test/t/olap.test
mysql-test/t/olap.test
+9
-0
mysql-test/t/xml.test
mysql-test/t/xml.test
+8
-0
sql/item_cmpfunc.cc
sql/item_cmpfunc.cc
+25
-12
sql/item_func.h
sql/item_func.h
+1
-1
sql/item_xmlfunc.h
sql/item_xmlfunc.h
+10
-2
No files found.
mysql-test/r/func_set.result
View file @
fbe27ca4
...
@@ -73,3 +73,33 @@ find_in_set(binary 'a', 'A,B,C')
...
@@ -73,3 +73,33 @@ find_in_set(binary 'a', 'A,B,C')
select find_in_set('1','3,1,');
select find_in_set('1','3,1,');
find_in_set('1','3,1,')
find_in_set('1','3,1,')
2
2
End of 4.1 tests
SELECT INTERVAL(0.0, NULL);
INTERVAL(0.0, NULL)
1
SELECT INTERVAL(0.0, CAST(NULL AS DECIMAL));
INTERVAL(0.0, CAST(NULL AS DECIMAL))
1
SELECT INTERVAL(0.0, CAST(DATE(NULL) AS DECIMAL));
INTERVAL(0.0, CAST(DATE(NULL) AS DECIMAL))
1
SELECT INTERVAL(0.0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INTERVAL(0.0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL)
8
SELECT INTERVAL(0.0, CAST(NULL AS DECIMAL), CAST(NULL AS DECIMAL),
CAST(NULL AS DECIMAL), CAST(NULL AS DECIMAL), CAST(NULL AS DECIMAL),
CAST(NULL AS DECIMAL), CAST(NULL AS DECIMAL), CAST(NULL AS DECIMAL));
INTERVAL(0.0, CAST(NULL AS DECIMAL), CAST(NULL AS DECIMAL),
CAST(NULL AS DECIMAL), CAST(NULL AS DECIMAL), CAST(NULL AS DECIMAL),
CAST(NULL AS DECIMAL), CAST(NULL AS DECIMAL), CAST(NULL AS DECIMAL))
8
SELECT INTERVAL(0.0, CAST(DATE(NULL) AS DECIMAL), CAST(DATE(NULL) AS DECIMAL),
CAST(DATE(NULL) AS DECIMAL), CAST(DATE(NULL) AS DECIMAL),
CAST(DATE(NULL) AS DECIMAL), CAST(DATE(NULL) AS DECIMAL),
CAST(DATE(NULL) AS DECIMAL), CAST(DATE(NULL) AS DECIMAL));
INTERVAL(0.0, CAST(DATE(NULL) AS DECIMAL), CAST(DATE(NULL) AS DECIMAL),
CAST(DATE(NULL) AS DECIMAL), CAST(DATE(NULL) AS DECIMAL),
CAST(DATE(NULL) AS DECIMAL), CAST(DATE(NULL) AS DECIMAL),
CAST(DATE(NULL) AS DECIMAL), CAST(DATE(NULL) AS DECIMAL))
8
End of 5.0 tests
mysql-test/r/olap.result
View file @
fbe27ca4
...
@@ -726,3 +726,11 @@ count(a)
...
@@ -726,3 +726,11 @@ count(a)
3
3
drop table t1;
drop table t1;
##############################################################
##############################################################
CREATE TABLE t1(a INT);
INSERT INTO t1 VALUES(0);
SELECT 1 FROM t1 GROUP BY (DATE(NULL)) WITH ROLLUP;
1
1
1
DROP TABLE t1;
End of 5.0 tests
mysql-test/r/xml.result
View file @
fbe27ca4
...
@@ -1022,4 +1022,11 @@ NULL NULL NULL
...
@@ -1022,4 +1022,11 @@ NULL NULL NULL
select updatexml(NULL, NULL, NULL);
select updatexml(NULL, NULL, NULL);
updatexml(NULL, NULL, NULL)
updatexml(NULL, NULL, NULL)
NULL
NULL
CREATE TABLE t1(a INT NOT NULL);
INSERT INTO t1 VALUES (0), (0);
SELECT 1 FROM t1 ORDER BY(UPDATEXML(a, '1', '1'));
1
1
1
DROP TABLE t1;
End of 5.1 tests
End of 5.1 tests
mysql-test/t/func_set.test
View file @
fbe27ca4
...
@@ -54,4 +54,21 @@ select find_in_set(binary 'a', 'A,B,C');
...
@@ -54,4 +54,21 @@ select find_in_set(binary 'a', 'A,B,C');
#
#
select
find_in_set
(
'1'
,
'3,1,'
);
select
find_in_set
(
'1'
,
'3,1,'
);
# End of 4.1 tests
--
echo
End
of
4.1
tests
#
# Bug #32560: crash with interval function and count(*)
#
SELECT
INTERVAL
(
0.0
,
NULL
);
SELECT
INTERVAL
(
0.0
,
CAST
(
NULL
AS
DECIMAL
));
SELECT
INTERVAL
(
0.0
,
CAST
(
DATE
(
NULL
)
AS
DECIMAL
));
SELECT
INTERVAL
(
0.0
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
);
SELECT
INTERVAL
(
0.0
,
CAST
(
NULL
AS
DECIMAL
),
CAST
(
NULL
AS
DECIMAL
),
CAST
(
NULL
AS
DECIMAL
),
CAST
(
NULL
AS
DECIMAL
),
CAST
(
NULL
AS
DECIMAL
),
CAST
(
NULL
AS
DECIMAL
),
CAST
(
NULL
AS
DECIMAL
),
CAST
(
NULL
AS
DECIMAL
));
SELECT
INTERVAL
(
0.0
,
CAST
(
DATE
(
NULL
)
AS
DECIMAL
),
CAST
(
DATE
(
NULL
)
AS
DECIMAL
),
CAST
(
DATE
(
NULL
)
AS
DECIMAL
),
CAST
(
DATE
(
NULL
)
AS
DECIMAL
),
CAST
(
DATE
(
NULL
)
AS
DECIMAL
),
CAST
(
DATE
(
NULL
)
AS
DECIMAL
),
CAST
(
DATE
(
NULL
)
AS
DECIMAL
),
CAST
(
DATE
(
NULL
)
AS
DECIMAL
));
--
echo
End
of
5.0
tests
mysql-test/t/olap.test
View file @
fbe27ca4
...
@@ -367,3 +367,12 @@ select count(a) from t1 group by null with rollup;
...
@@ -367,3 +367,12 @@ select count(a) from t1 group by null with rollup;
drop
table
t1
;
drop
table
t1
;
--
echo
##############################################################
--
echo
##############################################################
#
# Bug #32558: group by null-returning expression with rollup causes crash
#
CREATE
TABLE
t1
(
a
INT
);
INSERT
INTO
t1
VALUES
(
0
);
SELECT
1
FROM
t1
GROUP
BY
(
DATE
(
NULL
))
WITH
ROLLUP
;
DROP
TABLE
t1
;
--
echo
End
of
5.0
tests
mysql-test/t/xml.test
View file @
fbe27ca4
...
@@ -543,4 +543,12 @@ select updatexml(NULL, NULL, 1), updatexml(1, NULL, NULL),
...
@@ -543,4 +543,12 @@ select updatexml(NULL, NULL, 1), updatexml(1, NULL, NULL),
updatexml
(
NULL
,
1
,
NULL
);
updatexml
(
NULL
,
1
,
NULL
);
select
updatexml
(
NULL
,
NULL
,
NULL
);
select
updatexml
(
NULL
,
NULL
,
NULL
);
#
# Bug #32557: order by updatexml causes assertion in filesort
#
CREATE
TABLE
t1
(
a
INT
NOT
NULL
);
INSERT
INTO
t1
VALUES
(
0
),
(
0
);
SELECT
1
FROM
t1
ORDER
BY
(
UPDATEXML
(
a
,
'1'
,
'1'
));
DROP
TABLE
t1
;
--
echo
End
of
5.1
tests
--
echo
End
of
5.1
tests
sql/item_cmpfunc.cc
View file @
fbe27ca4
...
@@ -1694,26 +1694,29 @@ bool Item_func_opt_neg::eq(const Item *item, bool binary_cmp) const
...
@@ -1694,26 +1694,29 @@ bool Item_func_opt_neg::eq(const Item *item, bool binary_cmp) const
void
Item_func_interval
::
fix_length_and_dec
()
void
Item_func_interval
::
fix_length_and_dec
()
{
{
uint
rows
=
row
->
cols
();
use_decimal_comparison
=
((
row
->
element_index
(
0
)
->
result_type
()
==
use_decimal_comparison
=
((
row
->
element_index
(
0
)
->
result_type
()
==
DECIMAL_RESULT
)
||
DECIMAL_RESULT
)
||
(
row
->
element_index
(
0
)
->
result_type
()
==
(
row
->
element_index
(
0
)
->
result_type
()
==
INT_RESULT
));
INT_RESULT
));
if
(
row
->
cols
()
>
8
)
if
(
row
s
>
8
)
{
{
bool
consts
=
1
;
bool
not_null_consts
=
TRUE
;
for
(
uint
i
=
1
;
consts
&&
i
<
row
->
cols
()
;
i
++
)
for
(
uint
i
=
1
;
not_null_consts
&&
i
<
rows
;
i
++
)
{
{
consts
&=
row
->
element_index
(
i
)
->
const_item
();
Item
*
el
=
row
->
element_index
(
i
);
not_null_consts
&=
el
->
const_item
()
&
!
el
->
is_null
();
}
}
if
(
consts
&&
if
(
not_null_
consts
&&
(
intervals
=
(
intervals
=
(
interval_range
*
)
sql_alloc
(
sizeof
(
interval_range
)
*
(
row
->
cols
()
-
1
))))
(
interval_range
*
)
sql_alloc
(
sizeof
(
interval_range
)
*
(
rows
-
1
))))
{
{
if
(
use_decimal_comparison
)
if
(
use_decimal_comparison
)
{
{
for
(
uint
i
=
1
;
i
<
row
->
cols
()
;
i
++
)
for
(
uint
i
=
1
;
i
<
rows
;
i
++
)
{
{
Item
*
el
=
row
->
element_index
(
i
);
Item
*
el
=
row
->
element_index
(
i
);
interval_range
*
range
=
intervals
+
(
i
-
1
);
interval_range
*
range
=
intervals
+
(
i
-
1
);
...
@@ -1738,7 +1741,7 @@ void Item_func_interval::fix_length_and_dec()
...
@@ -1738,7 +1741,7 @@ void Item_func_interval::fix_length_and_dec()
}
}
else
else
{
{
for
(
uint
i
=
1
;
i
<
row
->
cols
()
;
i
++
)
for
(
uint
i
=
1
;
i
<
rows
;
i
++
)
{
{
intervals
[
i
-
1
].
dbl
=
row
->
element_index
(
i
)
->
val_real
();
intervals
[
i
-
1
].
dbl
=
row
->
element_index
(
i
)
->
val_real
();
}
}
...
@@ -1829,12 +1832,22 @@ longlong Item_func_interval::val_int()
...
@@ -1829,12 +1832,22 @@ longlong Item_func_interval::val_int()
((
el
->
result_type
()
==
DECIMAL_RESULT
)
||
((
el
->
result_type
()
==
DECIMAL_RESULT
)
||
(
el
->
result_type
()
==
INT_RESULT
)))
(
el
->
result_type
()
==
INT_RESULT
)))
{
{
my_decimal
e_dec_buf
,
*
e_dec
=
row
->
element_index
(
i
)
->
val_decimal
(
&
e_dec_buf
);
my_decimal
e_dec_buf
,
*
e_dec
=
el
->
val_decimal
(
&
e_dec_buf
);
/* Skip NULL ranges. */
if
(
el
->
null_value
)
continue
;
if
(
my_decimal_cmp
(
e_dec
,
dec
)
>
0
)
if
(
my_decimal_cmp
(
e_dec
,
dec
)
>
0
)
return
i
-
1
;
return
i
-
1
;
}
else
{
double
val
=
el
->
val_real
();
/* Skip NULL ranges. */
if
(
el
->
null_value
)
continue
;
if
(
val
>
value
)
return
i
-
1
;
}
}
else
if
(
row
->
element_index
(
i
)
->
val_real
()
>
value
)
return
i
-
1
;
}
}
return
i
-
1
;
return
i
-
1
;
}
}
...
...
sql/item_func.h
View file @
fbe27ca4
...
@@ -789,7 +789,7 @@ class Item_func_rollup_const :public Item_func
...
@@ -789,7 +789,7 @@ class Item_func_rollup_const :public Item_func
max_length
=
args
[
0
]
->
max_length
;
max_length
=
args
[
0
]
->
max_length
;
decimals
=
args
[
0
]
->
decimals
;
decimals
=
args
[
0
]
->
decimals
;
/* The item could be a NULL constant. */
/* The item could be a NULL constant. */
null_value
=
args
[
0
]
->
null_value
;
null_value
=
args
[
0
]
->
is_null
()
;
}
}
};
};
...
...
sql/item_xmlfunc.h
View file @
fbe27ca4
...
@@ -28,8 +28,16 @@ class Item_xml_str_func: public Item_str_func
...
@@ -28,8 +28,16 @@ class Item_xml_str_func: public Item_str_func
String
tmp_value
,
pxml
;
String
tmp_value
,
pxml
;
Item
*
nodeset_func
;
Item
*
nodeset_func
;
public:
public:
Item_xml_str_func
(
Item
*
a
,
Item
*
b
)
:
Item_str_func
(
a
,
b
)
{}
Item_xml_str_func
(
Item
*
a
,
Item
*
b
)
:
Item_xml_str_func
(
Item
*
a
,
Item
*
b
,
Item
*
c
)
:
Item_str_func
(
a
,
b
,
c
)
{}
Item_str_func
(
a
,
b
)
{
maybe_null
=
TRUE
;
}
Item_xml_str_func
(
Item
*
a
,
Item
*
b
,
Item
*
c
)
:
Item_str_func
(
a
,
b
,
c
)
{
maybe_null
=
TRUE
;
}
void
fix_length_and_dec
();
void
fix_length_and_dec
();
String
*
parse_xml
(
String
*
raw_xml
,
String
*
parsed_xml_buf
);
String
*
parse_xml
(
String
*
raw_xml
,
String
*
parsed_xml_buf
);
};
};
...
...
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