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
3a4146dc
Commit
3a4146dc
authored
May 29, 2006
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
local variable interval to interval_tmp because it hides
Event_timed::interval
parent
c7d7c47d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
20 deletions
+23
-20
sql/event_timed.cc
sql/event_timed.cc
+23
-20
No files found.
sql/event_timed.cc
View file @
3a4146dc
...
...
@@ -324,7 +324,7 @@ int
Event_timed
::
init_interval
(
THD
*
thd
,
Item
*
expr
,
interval_type
new_interval
)
{
String
value
;
INTERVAL
interval
;
INTERVAL
interval
_tmp
;
DBUG_ENTER
(
"Event_timed::init_interval"
);
...
...
@@ -332,71 +332,74 @@ Event_timed::init_interval(THD *thd, Item *expr, interval_type new_interval)
DBUG_RETURN
(
EVEX_PARSE_ERROR
);
value
.
alloc
(
MAX_DATETIME_FULL_WIDTH
*
MY_CHARSET_BIN_MB_MAXLEN
);
if
(
get_interval_value
(
expr
,
new_interval
,
&
value
,
&
interval
))
if
(
get_interval_value
(
expr
,
new_interval
,
&
value
,
&
interval
_tmp
))
DBUG_RETURN
(
EVEX_PARSE_ERROR
);
expression
=
0
;
switch
(
new_interval
)
{
case
INTERVAL_YEAR
:
expression
=
interval
.
year
;
expression
=
interval
_tmp
.
year
;
break
;
case
INTERVAL_QUARTER
:
case
INTERVAL_MONTH
:
expression
=
interval
.
month
;
expression
=
interval
_tmp
.
month
;
break
;
case
INTERVAL_WEEK
:
case
INTERVAL_DAY
:
expression
=
interval
.
day
;
expression
=
interval
_tmp
.
day
;
break
;
case
INTERVAL_HOUR
:
expression
=
interval
.
hour
;
expression
=
interval
_tmp
.
hour
;
break
;
case
INTERVAL_MINUTE
:
expression
=
interval
.
minute
;
expression
=
interval
_tmp
.
minute
;
break
;
case
INTERVAL_SECOND
:
expression
=
interval
.
second
;
expression
=
interval
_tmp
.
second
;
break
;
case
INTERVAL_YEAR_MONTH
:
// Allow YEAR-MONTH YYYYYMM
expression
=
interval
.
year
*
12
+
interval
.
month
;
expression
=
interval
_tmp
.
year
*
12
+
interval_tmp
.
month
;
break
;
case
INTERVAL_DAY_HOUR
:
expression
=
interval
.
day
*
24
+
interval
.
hour
;
expression
=
interval
_tmp
.
day
*
24
+
interval_tmp
.
hour
;
break
;
case
INTERVAL_DAY_MINUTE
:
expression
=
(
interval
.
day
*
24
+
interval
.
hour
)
*
60
+
interval
.
minute
;
expression
=
(
interval_tmp
.
day
*
24
+
interval_tmp
.
hour
)
*
60
+
interval_tmp
.
minute
;
break
;
case
INTERVAL_HOUR_SECOND
:
/* day is anyway 0 */
case
INTERVAL_DAY_SECOND
:
/* DAY_SECOND having problems because of leap seconds? */
expression
=
((
interval
.
day
*
24
+
interval
.
hour
)
*
60
+
interval
.
minute
)
*
60
+
interval
.
second
;
expression
=
((
interval_tmp
.
day
*
24
+
interval_tmp
.
hour
)
*
60
+
interval_tmp
.
minute
)
*
60
+
interval_tmp
.
second
;
break
;
case
INTERVAL_MINUTE_MICROSECOND
:
/* day and hour are 0 */
case
INTERVAL_HOUR_MICROSECOND
:
/* day is anyway 0 */
case
INTERVAL_DAY_MICROSECOND
:
DBUG_RETURN
(
EVEX_MICROSECOND_UNSUP
);
expression
=
((((
interval
.
day
*
24
)
+
interval
.
hour
)
*
60
+
interval
.
minute
)
*
60
+
interval
.
second
)
*
1000000L
+
interval
.
second_part
;
expression
=
((((
interval_tmp
.
day
*
24
)
+
interval_tmp
.
hour
)
*
60
+
interval_tmp
.
minute
)
*
60
+
interval_tmp
.
second
)
*
1000000L
+
interval_tmp
.
second_part
;
break
;
case
INTERVAL_HOUR_MINUTE
:
expression
=
interval
.
hour
*
60
+
interval
.
minute
;
expression
=
interval
_tmp
.
hour
*
60
+
interval_tmp
.
minute
;
break
;
case
INTERVAL_MINUTE_SECOND
:
expression
=
interval
.
minute
*
60
+
interval
.
second
;
expression
=
interval
_tmp
.
minute
*
60
+
interval_tmp
.
second
;
break
;
case
INTERVAL_SECOND_MICROSECOND
:
DBUG_RETURN
(
EVEX_MICROSECOND_UNSUP
);
expression
=
interval
.
second
*
1000000L
+
interval
.
second_part
;
expression
=
interval
_tmp
.
second
*
1000000L
+
interval_tmp
.
second_part
;
break
;
case
INTERVAL_MICROSECOND
:
DBUG_RETURN
(
EVEX_MICROSECOND_UNSUP
);
}
if
(
interval
.
neg
||
expression
>
EVEX_MAX_INTERVAL_VALUE
)
if
(
interval
_tmp
.
neg
||
expression
>
EVEX_MAX_INTERVAL_VALUE
)
DBUG_RETURN
(
EVEX_BAD_PARAMS
);
this
->
interval
=
new_interval
;
interval
=
new_interval
;
DBUG_RETURN
(
0
);
}
...
...
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