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
75afe5ca
Commit
75afe5ca
authored
May 30, 2007
by
evgen@moonbone.local
Browse files
Options
Browse Files
Download
Plain Diff
Merge moonbone.local:/mnt/gentoo64/work/bk-trees/mysql-5.0-opt
into moonbone.local:/mnt/gentoo64/work/test-5.1-opt-mysql
parents
51de1c57
22c1bfbb
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
94 additions
and
30 deletions
+94
-30
mysql-test/r/func_date_add.result
mysql-test/r/func_date_add.result
+11
-0
mysql-test/r/metadata.result
mysql-test/r/metadata.result
+11
-0
mysql-test/r/olap.result
mysql-test/r/olap.result
+2
-2
mysql-test/r/sp.result
mysql-test/r/sp.result
+11
-0
mysql-test/r/view.result
mysql-test/r/view.result
+1
-1
mysql-test/t/func_date_add.test
mysql-test/t/func_date_add.test
+10
-0
mysql-test/t/metadata.test
mysql-test/t/metadata.test
+11
-0
mysql-test/t/sp.test
mysql-test/t/sp.test
+20
-0
sql/field.h
sql/field.h
+1
-1
sql/item_cmpfunc.cc
sql/item_cmpfunc.cc
+6
-1
sql/item_func.cc
sql/item_func.cc
+3
-2
sql/item_timefunc.cc
sql/item_timefunc.cc
+0
-21
sql/sql_select.cc
sql/sql_select.cc
+7
-2
No files found.
mysql-test/r/func_date_add.result
View file @
75afe5ca
...
...
@@ -84,4 +84,15 @@ CAST('2006-09-26' AS DATE) + INTERVAL 1 YEAR
SELECT CAST('2006-09-26' AS DATE) + INTERVAL 1 WEEK;
CAST('2006-09-26' AS DATE) + INTERVAL 1 WEEK
2006-10-03
create table t1 (a int, b varchar(10));
insert into t1 values (1, '2001-01-01'),(2, '2002-02-02');
select '2007-01-01' + interval a day from t1;
'2007-01-01' + interval a day
2007-01-02
2007-01-03
select b + interval a day from t1;
b + interval a day
2001-01-02
2002-02-04
drop table t1;
End of 5.0 tests
mysql-test/r/metadata.result
View file @
75afe5ca
...
...
@@ -130,3 +130,14 @@ def v3 renamed 8 12 0 Y 32896 0 63
renamed
drop table t1;
drop view v1,v2,v3;
select a.* from (select 2147483648 as v_large) a;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
def a v_large v_large 8 10 10 N 32769 0 63
v_large
2147483648
select a.* from (select 214748364 as v_small) a;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
def a v_small v_small 3 9 9 N 32769 0 63
v_small
214748364
End of 5.0 tests
mysql-test/r/olap.result
View file @
75afe5ca
...
...
@@ -696,8 +696,8 @@ CREATE VIEW v1 AS
SELECT a, LENGTH(a), COUNT(*) FROM t1 GROUP BY a WITH ROLLUP;
DESC v1;
Field Type Null Key Default Extra
a
int(11) YES 0
LENGTH(a) int(10) YES NULL
a
bigint(11) YES NULL
LENGTH(a)
big
int(10) YES NULL
COUNT(*) bigint(21) NO 0
SELECT * FROM v1;
a LENGTH(a) COUNT(*)
...
...
mysql-test/r/sp.result
View file @
75afe5ca
...
...
@@ -6244,3 +6244,14 @@ count(*)
3
drop table t1,t2;
drop function bug27354;
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (1),(2);
CREATE FUNCTION metered(a INT) RETURNS INT RETURN 12;
CREATE VIEW v1 AS SELECT test.metered(a) as metered FROM t1;
SHOW CREATE VIEW v1;
View Create View
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `test`.`metered`(`t1`.`a`) AS `metered` from `t1`
DROP VIEW v1;
DROP FUNCTION metered;
DROP TABLE t1;
End of 5.0 tests
mysql-test/r/view.result
View file @
75afe5ca
...
...
@@ -2771,7 +2771,7 @@ CREATE TABLE t1 (i int, j int);
CREATE VIEW v1 AS SELECT COALESCE(i,j) FROM t1;
DESCRIBE v1;
Field Type Null Key Default Extra
COALESCE(i,j) int(11) YES NULL
COALESCE(i,j)
big
int(11) YES NULL
CREATE TABLE t2 SELECT COALESCE(i,j) FROM t1;
DESCRIBE t2;
Field Type Null Key Default Extra
...
...
mysql-test/t/func_date_add.test
View file @
75afe5ca
...
...
@@ -77,4 +77,14 @@ SELECT CAST('2006-09-26' AS DATE) + INTERVAL 1 MONTH;
SELECT
CAST
(
'2006-09-26'
AS
DATE
)
+
INTERVAL
1
YEAR
;
SELECT
CAST
(
'2006-09-26'
AS
DATE
)
+
INTERVAL
1
WEEK
;
#
# Bug#28450: The Item_date_add_interval in select list may fail the field
# type assertion.
#
create
table
t1
(
a
int
,
b
varchar
(
10
));
insert
into
t1
values
(
1
,
'2001-01-01'
),(
2
,
'2002-02-02'
);
select
'2007-01-01'
+
interval
a
day
from
t1
;
select
b
+
interval
a
day
from
t1
;
drop
table
t1
;
--
echo
End
of
5.0
tests
mysql-test/t/metadata.test
View file @
75afe5ca
...
...
@@ -81,3 +81,14 @@ drop view v1,v2,v3;
--
disable_metadata
# End of 4.1 tests
#
# Bug #28492: subselect returns LONG in >5.0.24a and LONGLONG in <=5.0.24a
#
--
enable_metadata
select
a
.*
from
(
select
2147483648
as
v_large
)
a
;
select
a
.*
from
(
select
214748364
as
v_small
)
a
;
--
disable_metadata
--
echo
End
of
5.0
tests
mysql-test/t/sp.test
View file @
75afe5ca
...
...
@@ -7204,3 +7204,23 @@ select count(*) from t1 /* must be 3 */;
drop
table
t1
,
t2
;
drop
function
bug27354
;
#
# Bug #28605: SHOW CREATE VIEW with views using stored_procedures no longer
# showing SP names.
#
CREATE
TABLE
t1
(
a
INT
);
INSERT
INTO
t1
VALUES
(
1
),(
2
);
CREATE
FUNCTION
metered
(
a
INT
)
RETURNS
INT
RETURN
12
;
CREATE
VIEW
v1
AS
SELECT
test
.
metered
(
a
)
as
metered
FROM
t1
;
SHOW
CREATE
VIEW
v1
;
DROP
VIEW
v1
;
DROP
FUNCTION
metered
;
DROP
TABLE
t1
;
--
echo
End
of
5.0
tests
sql/field.h
View file @
75afe5ca
...
...
@@ -742,7 +742,7 @@ class Field_long :public Field_num {
void
sort_string
(
char
*
buff
,
uint
length
);
uint32
pack_length
()
const
{
return
4
;
}
void
sql_type
(
String
&
str
)
const
;
uint32
max_display_length
()
{
return
11
;
}
uint32
max_display_length
()
{
return
MY_INT32_NUM_DECIMAL_DIGITS
;
}
};
...
...
sql/item_cmpfunc.cc
View file @
75afe5ca
...
...
@@ -819,7 +819,12 @@ get_datetime_value(THD *thd, Item ***item_arg, Item **cache_arg,
{
value
=
item
->
val_int
();
*
is_null
=
item
->
null_value
;
if
(
item
->
field_type
()
==
MYSQL_TYPE_DATE
)
/*
Item_date_add_interval may return MYSQL_TYPE_STRING as the result
field type. To detect that the DATE value has been returned we
compare it with 1000000L - any DATE value should be less than it.
*/
if
(
item
->
field_type
()
==
MYSQL_TYPE_DATE
||
value
<
100000000L
)
value
*=
1000000L
;
}
else
...
...
sql/item_func.cc
View file @
75afe5ca
...
...
@@ -5185,10 +5185,11 @@ Item_func_sp::func_name() const
{
THD
*
thd
=
current_thd
;
/* Calculate length to avoid reallocation of string for sure */
uint
len
=
((
m_name
->
m_explicit_name
?
m_name
->
m_db
.
length
:
0
+
uint
len
=
((
(
m_name
->
m_explicit_name
?
m_name
->
m_db
.
length
:
0
)
+
m_name
->
m_name
.
length
)
*
2
+
//characters*quoting
2
+
// ` and `
1
+
// .
(
m_name
->
m_explicit_name
?
3
:
0
)
+
// '`', '`' and '.' for the db
1
+
// end of string
ALIGN_SIZE
(
1
));
// to avoid String reallocation
String
qname
((
char
*
)
alloc_root
(
thd
->
mem_root
,
len
),
len
,
...
...
sql/item_timefunc.cc
View file @
75afe5ca
...
...
@@ -2058,27 +2058,6 @@ bool Item_date_add_interval::get_date(MYSQL_TIME *ltime, uint fuzzy_date)
if
((
null_value
=
date_add_interval
(
ltime
,
int_type
,
interval
)))
return
1
;
/* Adjust cached_field_type according to the detected type. */
if
(
cached_field_type
==
MYSQL_TYPE_STRING
)
{
switch
(
ltime
->
time_type
)
{
case
MYSQL_TIMESTAMP_DATE
:
cached_field_type
=
MYSQL_TYPE_DATE
;
break
;
case
MYSQL_TIMESTAMP_DATETIME
:
cached_field_type
=
MYSQL_TYPE_DATETIME
;
break
;
case
MYSQL_TIMESTAMP_TIME
:
cached_field_type
=
MYSQL_TYPE_TIME
;
break
;
default:
/* Shouldn't get here. */
DBUG_ASSERT
(
0
);
break
;
}
}
return
0
;
}
...
...
sql/sql_select.cc
View file @
75afe5ca
...
...
@@ -9090,8 +9090,13 @@ static Field *create_tmp_field_from_item(THD *thd, Item *item, TABLE *table,
item
->
name
,
item
->
decimals
,
TRUE
);
break
;
case
INT_RESULT
:
/* Select an integer type with the minimal fit precision */
if
(
item
->
max_length
>
MY_INT32_NUM_DECIMAL_DIGITS
)
/*
Select an integer type with the minimal fit precision.
MY_INT32_NUM_DECIMAL_DIGITS is sign inclusive, don't consider the sign.
Values with MY_INT32_NUM_DECIMAL_DIGITS digits may or may not fit into
Field_long : make them Field_longlong.
*/
if
(
item
->
max_length
>=
(
MY_INT32_NUM_DECIMAL_DIGITS
-
1
))
new_field
=
new
Field_longlong
(
item
->
max_length
,
maybe_null
,
item
->
name
,
item
->
unsigned_flag
);
else
...
...
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