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
968ba3c2
Commit
968ba3c2
authored
Jun 29, 2006
by
ingo@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge mysql.com:/home/mydev/mysql-4.1-bug17877
into mysql.com:/home/mydev/mysql-5.0-bug11824
parents
3982eb3b
d8499f2d
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
134 additions
and
12 deletions
+134
-12
myisam/mi_check.c
myisam/mi_check.c
+3
-2
myisam/mi_key.c
myisam/mi_key.c
+1
-1
myisam/rt_index.c
myisam/rt_index.c
+5
-3
myisam/rt_mbr.c
myisam/rt_mbr.c
+5
-1
mysql-test/r/func_sapdb.result
mysql-test/r/func_sapdb.result
+6
-0
mysql-test/r/func_time.result
mysql-test/r/func_time.result
+6
-0
mysql-test/r/gis-rtree.result
mysql-test/r/gis-rtree.result
+40
-0
mysql-test/r/symlink.result
mysql-test/r/symlink.result
+6
-0
mysql-test/t/func_sapdb.test
mysql-test/t/func_sapdb.test
+2
-0
mysql-test/t/func_time.test
mysql-test/t/func_time.test
+4
-0
mysql-test/t/gis-rtree.test
mysql-test/t/gis-rtree.test
+44
-0
sql/item_timefunc.cc
sql/item_timefunc.cc
+6
-5
sql/sql_parse.cc
sql/sql_parse.cc
+6
-0
No files found.
myisam/mi_check.c
View file @
968ba3c2
...
@@ -1158,13 +1158,14 @@ int chk_data_link(MI_CHECK *param, MI_INFO *info,int extend)
...
@@ -1158,13 +1158,14 @@ int chk_data_link(MI_CHECK *param, MI_INFO *info,int extend)
#ifdef HAVE_RTREE_KEYS
#ifdef HAVE_RTREE_KEYS
(
keyinfo
->
flag
&
HA_SPATIAL
)
?
(
keyinfo
->
flag
&
HA_SPATIAL
)
?
rtree_find_first
(
info
,
key
,
info
->
lastkey
,
key_length
,
rtree_find_first
(
info
,
key
,
info
->
lastkey
,
key_length
,
SEARCH_SAME
)
:
MBR_EQUAL
|
MBR_DATA
)
:
#endif
#endif
_mi_search
(
info
,
keyinfo
,
info
->
lastkey
,
key_length
,
_mi_search
(
info
,
keyinfo
,
info
->
lastkey
,
key_length
,
SEARCH_SAME
,
info
->
s
->
state
.
key_root
[
key
]);
SEARCH_SAME
,
info
->
s
->
state
.
key_root
[
key
]);
if
(
search_result
)
if
(
search_result
)
{
{
mi_check_print_error
(
param
,
"Record at: %10s Can't find key for index: %2d"
,
mi_check_print_error
(
param
,
"Record at: %10s "
"Can't find key for index: %2d"
,
llstr
(
start_recpos
,
llbuff
),
key
+
1
);
llstr
(
start_recpos
,
llbuff
),
key
+
1
);
if
(
error
++
>
MAXERR
||
!
(
param
->
testflag
&
T_VERBOSE
))
if
(
error
++
>
MAXERR
||
!
(
param
->
testflag
&
T_VERBOSE
))
goto
err2
;
goto
err2
;
...
...
myisam/mi_key.c
View file @
968ba3c2
...
@@ -64,7 +64,7 @@ uint _mi_make_key(register MI_INFO *info, uint keynr, uchar *key,
...
@@ -64,7 +64,7 @@ uint _mi_make_key(register MI_INFO *info, uint keynr, uchar *key,
TODO: nulls processing
TODO: nulls processing
*/
*/
#ifdef HAVE_SPATIAL
#ifdef HAVE_SPATIAL
return
sp_make_key
(
info
,
keynr
,
key
,
record
,
filepos
);
DBUG_RETURN
(
sp_make_key
(
info
,
keynr
,
key
,
record
,
filepos
)
);
#else
#else
DBUG_ASSERT
(
0
);
/* mi_open should check that this never happens*/
DBUG_ASSERT
(
0
);
/* mi_open should check that this never happens*/
#endif
#endif
...
...
myisam/rt_index.c
View file @
968ba3c2
...
@@ -183,9 +183,11 @@ int rtree_find_first(MI_INFO *info, uint keynr, uchar *key, uint key_length,
...
@@ -183,9 +183,11 @@ int rtree_find_first(MI_INFO *info, uint keynr, uchar *key, uint key_length,
return
-
1
;
return
-
1
;
}
}
/* Save searched key */
/*
memcpy
(
info
->
first_mbr_key
,
key
,
keyinfo
->
keylength
-
Save searched key, include data pointer.
info
->
s
->
base
.
rec_reflength
);
The data pointer is required if the search_flag contains MBR_DATA.
*/
memcpy
(
info
->
first_mbr_key
,
key
,
keyinfo
->
keylength
);
info
->
last_rkey_length
=
key_length
;
info
->
last_rkey_length
=
key_length
;
info
->
rtree_recursion_depth
=
-
1
;
info
->
rtree_recursion_depth
=
-
1
;
...
...
myisam/rt_mbr.c
View file @
968ba3c2
...
@@ -52,10 +52,14 @@
...
@@ -52,10 +52,14 @@
if (EQUAL_CMP(amin, amax, bmin, bmax)) \
if (EQUAL_CMP(amin, amax, bmin, bmax)) \
return 1; \
return 1; \
} \
} \
else
/* if (nextflag & MBR_DISJOINT) */
\
else
if (nextflag & MBR_DISJOINT)
\
{ \
{ \
if (DISJOINT_CMP(amin, amax, bmin, bmax)) \
if (DISJOINT_CMP(amin, amax, bmin, bmax)) \
return 1; \
return 1; \
}\
else
/* if unknown comparison operator */
\
{ \
DBUG_ASSERT(0); \
}
}
#define RT_CMP_KORR(type, korr_func, len, nextflag) \
#define RT_CMP_KORR(type, korr_func, len, nextflag) \
...
...
mysql-test/r/func_sapdb.result
View file @
968ba3c2
...
@@ -81,6 +81,12 @@ makedate(1997,1)
...
@@ -81,6 +81,12 @@ makedate(1997,1)
select makedate(1997,0);
select makedate(1997,0);
makedate(1997,0)
makedate(1997,0)
NULL
NULL
select makedate(9999,365);
makedate(9999,365)
9999-12-31
select makedate(9999,366);
makedate(9999,366)
NULL
select addtime("1997-12-31 23:59:59.999999", "1 1:1:1.000002");
select addtime("1997-12-31 23:59:59.999999", "1 1:1:1.000002");
addtime("1997-12-31 23:59:59.999999", "1 1:1:1.000002")
addtime("1997-12-31 23:59:59.999999", "1 1:1:1.000002")
1998-01-02 01:01:01.000001
1998-01-02 01:01:01.000001
...
...
mysql-test/r/func_time.result
View file @
968ba3c2
...
@@ -361,6 +361,12 @@ extract(SECOND FROM "1999-01-02 10:11:12")
...
@@ -361,6 +361,12 @@ extract(SECOND FROM "1999-01-02 10:11:12")
select extract(MONTH FROM "2001-02-00");
select extract(MONTH FROM "2001-02-00");
extract(MONTH FROM "2001-02-00")
extract(MONTH FROM "2001-02-00")
2
2
SELECT DATE_SUB(str_to_date('9999-12-31 00:01:00','%Y-%m-%d %H:%i:%s'), INTERVAL 1 MINUTE);
DATE_SUB(str_to_date('9999-12-31 00:01:00','%Y-%m-%d %H:%i:%s'), INTERVAL 1 MINUTE)
9999-12-31 00:00:00
SELECT DATE_ADD(str_to_date('9999-12-30 23:59:00','%Y-%m-%d %H:%i:%s'), INTERVAL 1 MINUTE);
DATE_ADD(str_to_date('9999-12-30 23:59:00','%Y-%m-%d %H:%i:%s'), INTERVAL 1 MINUTE)
9999-12-31 00:00:00
SELECT EXTRACT(QUARTER FROM '2004-01-15') AS quarter;
SELECT EXTRACT(QUARTER FROM '2004-01-15') AS quarter;
quarter
quarter
1
1
...
...
mysql-test/r/gis-rtree.result
View file @
968ba3c2
...
@@ -816,3 +816,43 @@ check table t1 extended;
...
@@ -816,3 +816,43 @@ 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 (
c1 geometry NOT NULL default '',
SPATIAL KEY i1 (c1(32))
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
INSERT INTO t1 (c1) VALUES (
PolygonFromText('POLYGON((-18.6086111000 -66.9327777000,
-18.6055555000 -66.8158332999,
-18.7186111000 -66.8102777000,
-18.7211111000 -66.9269443999,
-18.6086111000 -66.9327777000))'));
CHECK TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
test.t1 check status OK
DROP TABLE t1;
CREATE TABLE t1 (
c1 geometry NOT NULL default '',
SPATIAL KEY i1 (c1(32))
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
INSERT INTO t1 (c1) VALUES (
PolygonFromText('POLYGON((-18.6086111000 -66.9327777000,
-18.6055555000 -66.8158332999,
-18.7186111000 -66.8102777000,
-18.7211111000 -66.9269443999,
-18.6086111000 -66.9327777000))'));
INSERT INTO t1 (c1) VALUES (
PolygonFromText('POLYGON((-65.7402776999 -96.6686111000,
-65.7372222000 -96.5516666000,
-65.8502777000 -96.5461111000,
-65.8527777000 -96.6627777000,
-65.7402776999 -96.6686111000))'));
INSERT INTO t1 (c1) VALUES (
PolygonFromText('POLYGON((-18.6086111000 -66.9327777000,
-18.6055555000 -66.8158332999,
-18.7186111000 -66.8102777000,
-18.7211111000 -66.9269443999,
-18.6086111000 -66.9327777000))'));
CHECK TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
test.t1 check status OK
DROP TABLE t1;
mysql-test/r/symlink.result
View file @
968ba3c2
...
@@ -74,18 +74,24 @@ t9 CREATE TABLE `t9` (
...
@@ -74,18 +74,24 @@ t9 CREATE TABLE `t9` (
) ENGINE=MyISAM AUTO_INCREMENT=16725 DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/tmp/' INDEX DIRECTORY='MYSQLTEST_VARDIR/run/'
) ENGINE=MyISAM AUTO_INCREMENT=16725 DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/tmp/' INDEX DIRECTORY='MYSQLTEST_VARDIR/run/'
drop database mysqltest;
drop database mysqltest;
create table t1 (a int not null) engine=myisam;
create table t1 (a int not null) engine=myisam;
Warnings:
Warning 0 DATA DIRECTORY option ignored
show create table t1;
show create table t1;
Table Create Table
Table Create Table
t1 CREATE TABLE `t1` (
t1 CREATE TABLE `t1` (
`a` int(11) NOT NULL
`a` int(11) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
) ENGINE=MyISAM DEFAULT CHARSET=latin1
alter table t1 add b int;
alter table t1 add b int;
Warnings:
Warning 0 DATA DIRECTORY option ignored
show create table t1;
show create table t1;
Table Create Table
Table Create Table
t1 CREATE TABLE `t1` (
t1 CREATE TABLE `t1` (
`a` int(11) NOT NULL,
`a` int(11) NOT NULL,
`b` int(11) default NULL
`b` int(11) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
) ENGINE=MyISAM DEFAULT CHARSET=latin1
Warnings:
Warning 0 INDEX DIRECTORY option ignored
show create table t1;
show create table t1;
Table Create Table
Table Create Table
t1 CREATE TABLE `t1` (
t1 CREATE TABLE `t1` (
...
...
mysql-test/t/func_sapdb.test
View file @
968ba3c2
...
@@ -43,6 +43,8 @@ select weekofyear("1997-11-30 23:59:59.000001");
...
@@ -43,6 +43,8 @@ select weekofyear("1997-11-30 23:59:59.000001");
select
makedate
(
1997
,
1
);
select
makedate
(
1997
,
1
);
select
makedate
(
1997
,
0
);
select
makedate
(
1997
,
0
);
select
makedate
(
9999
,
365
);
select
makedate
(
9999
,
366
);
#Time functions
#Time functions
...
...
mysql-test/t/func_time.test
View file @
968ba3c2
...
@@ -143,6 +143,10 @@ select extract(SECOND FROM "1999-01-02 10:11:12");
...
@@ -143,6 +143,10 @@ select extract(SECOND FROM "1999-01-02 10:11:12");
select
extract
(
MONTH
FROM
"2001-02-00"
);
select
extract
(
MONTH
FROM
"2001-02-00"
);
#
#
# MySQL Bugs: #12356: DATE_SUB or DATE_ADD incorrectly returns null
#
SELECT
DATE_SUB
(
str_to_date
(
'9999-12-31 00:01:00'
,
'%Y-%m-%d %H:%i:%s'
),
INTERVAL
1
MINUTE
);
SELECT
DATE_ADD
(
str_to_date
(
'9999-12-30 23:59:00'
,
'%Y-%m-%d %H:%i:%s'
),
INTERVAL
1
MINUTE
);
# test EXTRACT QUARTER (Bug #18100)
# test EXTRACT QUARTER (Bug #18100)
#
#
...
...
mysql-test/t/gis-rtree.test
View file @
968ba3c2
...
@@ -187,4 +187,48 @@ check table t1 extended;
...
@@ -187,4 +187,48 @@ check table t1 extended;
drop
table
t1
;
drop
table
t1
;
#
# Bug#17877 - Corrupted spatial index
#
CREATE
TABLE
t1
(
c1
geometry
NOT
NULL
default
''
,
SPATIAL
KEY
i1
(
c1
(
32
))
)
ENGINE
=
MyISAM
DEFAULT
CHARSET
=
latin1
;
INSERT
INTO
t1
(
c1
)
VALUES
(
PolygonFromText
(
'POLYGON((-18.6086111000 -66.9327777000,
-18.6055555000 -66.8158332999,
-18.7186111000 -66.8102777000,
-18.7211111000 -66.9269443999,
-18.6086111000 -66.9327777000))'
));
# This showed a missing key.
CHECK
TABLE
t1
EXTENDED
;
DROP
TABLE
t1
;
#
CREATE
TABLE
t1
(
c1
geometry
NOT
NULL
default
''
,
SPATIAL
KEY
i1
(
c1
(
32
))
)
ENGINE
=
MyISAM
DEFAULT
CHARSET
=
latin1
;
INSERT
INTO
t1
(
c1
)
VALUES
(
PolygonFromText
(
'POLYGON((-18.6086111000 -66.9327777000,
-18.6055555000 -66.8158332999,
-18.7186111000 -66.8102777000,
-18.7211111000 -66.9269443999,
-18.6086111000 -66.9327777000))'
));
INSERT
INTO
t1
(
c1
)
VALUES
(
PolygonFromText
(
'POLYGON((-65.7402776999 -96.6686111000,
-65.7372222000 -96.5516666000,
-65.8502777000 -96.5461111000,
-65.8527777000 -96.6627777000,
-65.7402776999 -96.6686111000))'
));
# This is the same as the first insert to get a non-unique key.
INSERT
INTO
t1
(
c1
)
VALUES
(
PolygonFromText
(
'POLYGON((-18.6086111000 -66.9327777000,
-18.6055555000 -66.8158332999,
-18.7186111000 -66.8102777000,
-18.7211111000 -66.9269443999,
-18.6086111000 -66.9327777000))'
));
# This showed (and still shows) OK.
CHECK
TABLE
t1
EXTENDED
;
DROP
TABLE
t1
;
# End of 4.1 tests
# End of 4.1 tests
sql/item_timefunc.cc
View file @
968ba3c2
...
@@ -27,6 +27,7 @@
...
@@ -27,6 +27,7 @@
/* TODO: Move month and days to language files */
/* TODO: Move month and days to language files */
/* Day number for Dec 31st, 9999 */
#define MAX_DAY_NUMBER 3652424L
#define MAX_DAY_NUMBER 3652424L
static
const
char
*
month_names
[]
=
static
const
char
*
month_names
[]
=
...
@@ -408,7 +409,7 @@ static bool extract_date_time(DATE_TIME_FORMAT *format,
...
@@ -408,7 +409,7 @@ static bool extract_date_time(DATE_TIME_FORMAT *format,
if
(
yearday
>
0
)
if
(
yearday
>
0
)
{
{
uint
days
=
calc_daynr
(
l_time
->
year
,
1
,
1
)
+
yearday
-
1
;
uint
days
=
calc_daynr
(
l_time
->
year
,
1
,
1
)
+
yearday
-
1
;
if
(
days
<=
0
||
days
>
=
MAX_DAY_NUMBER
)
if
(
days
<=
0
||
days
>
MAX_DAY_NUMBER
)
goto
err
;
goto
err
;
get_date_from_daynr
(
days
,
&
l_time
->
year
,
&
l_time
->
month
,
&
l_time
->
day
);
get_date_from_daynr
(
days
,
&
l_time
->
year
,
&
l_time
->
month
,
&
l_time
->
day
);
}
}
...
@@ -454,7 +455,7 @@ static bool extract_date_time(DATE_TIME_FORMAT *format,
...
@@ -454,7 +455,7 @@ static bool extract_date_time(DATE_TIME_FORMAT *format,
(
weekday
-
1
);
(
weekday
-
1
);
}
}
if
(
days
<=
0
||
days
>
=
MAX_DAY_NUMBER
)
if
(
days
<=
0
||
days
>
MAX_DAY_NUMBER
)
goto
err
;
goto
err
;
get_date_from_daynr
(
days
,
&
l_time
->
year
,
&
l_time
->
month
,
&
l_time
->
day
);
get_date_from_daynr
(
days
,
&
l_time
->
year
,
&
l_time
->
month
,
&
l_time
->
day
);
}
}
...
@@ -2035,7 +2036,7 @@ bool Item_date_add_interval::get_date(TIME *ltime, uint fuzzy_date)
...
@@ -2035,7 +2036,7 @@ bool Item_date_add_interval::get_date(TIME *ltime, uint fuzzy_date)
ltime
->
hour
=
(
uint
)
(
sec
/
3600
);
ltime
->
hour
=
(
uint
)
(
sec
/
3600
);
daynr
=
calc_daynr
(
ltime
->
year
,
ltime
->
month
,
1
)
+
days
;
daynr
=
calc_daynr
(
ltime
->
year
,
ltime
->
month
,
1
)
+
days
;
/* Day number from year 0 to 9999-12-31 */
/* Day number from year 0 to 9999-12-31 */
if
((
ulonglong
)
daynr
>
=
MAX_DAY_NUMBER
)
if
((
ulonglong
)
daynr
>
MAX_DAY_NUMBER
)
goto
invalid_date
;
goto
invalid_date
;
get_date_from_daynr
((
long
)
daynr
,
&
ltime
->
year
,
&
ltime
->
month
,
get_date_from_daynr
((
long
)
daynr
,
&
ltime
->
year
,
&
ltime
->
month
,
&
ltime
->
day
);
&
ltime
->
day
);
...
@@ -2046,7 +2047,7 @@ bool Item_date_add_interval::get_date(TIME *ltime, uint fuzzy_date)
...
@@ -2046,7 +2047,7 @@ bool Item_date_add_interval::get_date(TIME *ltime, uint fuzzy_date)
period
=
(
calc_daynr
(
ltime
->
year
,
ltime
->
month
,
ltime
->
day
)
+
period
=
(
calc_daynr
(
ltime
->
year
,
ltime
->
month
,
ltime
->
day
)
+
sign
*
(
long
)
interval
.
day
);
sign
*
(
long
)
interval
.
day
);
/* Daynumber from year 0 to 9999-12-31 */
/* Daynumber from year 0 to 9999-12-31 */
if
((
ulong
)
period
>
=
MAX_DAY_NUMBER
)
if
((
ulong
)
period
>
MAX_DAY_NUMBER
)
goto
invalid_date
;
goto
invalid_date
;
get_date_from_daynr
((
long
)
period
,
&
ltime
->
year
,
&
ltime
->
month
,
&
ltime
->
day
);
get_date_from_daynr
((
long
)
period
,
&
ltime
->
year
,
&
ltime
->
month
,
&
ltime
->
day
);
break
;
break
;
...
@@ -2570,7 +2571,7 @@ String *Item_func_makedate::val_str(String *str)
...
@@ -2570,7 +2571,7 @@ String *Item_func_makedate::val_str(String *str)
days
=
calc_daynr
(
yearnr
,
1
,
1
)
+
daynr
-
1
;
days
=
calc_daynr
(
yearnr
,
1
,
1
)
+
daynr
-
1
;
/* Day number from year 0 to 9999-12-31 */
/* Day number from year 0 to 9999-12-31 */
if
(
days
>=
0
&&
days
<
MAX_DAY_NUMBER
)
if
(
days
>=
0
&&
days
<
=
MAX_DAY_NUMBER
)
{
{
null_value
=
0
;
null_value
=
0
;
get_date_from_daynr
(
days
,
&
l_time
.
year
,
&
l_time
.
month
,
&
l_time
.
day
);
get_date_from_daynr
(
days
,
&
l_time
.
year
,
&
l_time
.
month
,
&
l_time
.
day
);
...
...
sql/sql_parse.cc
View file @
968ba3c2
...
@@ -3057,6 +3057,12 @@ mysql_execute_command(THD *thd)
...
@@ -3057,6 +3057,12 @@ mysql_execute_command(THD *thd)
}
}
}
}
/* Don't yet allow changing of symlinks with ALTER TABLE */
/* Don't yet allow changing of symlinks with ALTER TABLE */
if
(
lex
->
create_info
.
data_file_name
)
push_warning
(
thd
,
MYSQL_ERROR
::
WARN_LEVEL_WARN
,
0
,
"DATA DIRECTORY option ignored"
);
if
(
lex
->
create_info
.
index_file_name
)
push_warning
(
thd
,
MYSQL_ERROR
::
WARN_LEVEL_WARN
,
0
,
"INDEX DIRECTORY option ignored"
);
lex
->
create_info
.
data_file_name
=
lex
->
create_info
.
index_file_name
=
0
;
lex
->
create_info
.
data_file_name
=
lex
->
create_info
.
index_file_name
=
0
;
/* ALTER TABLE ends previous transaction */
/* ALTER TABLE ends previous transaction */
if
(
end_active_trans
(
thd
))
if
(
end_active_trans
(
thd
))
...
...
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