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
14cf209a
Commit
14cf209a
authored
Oct 10, 2006
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge ahristov@bk-internal.mysql.com:/home/bk/mysql-5.1-runtime
into example.com:/work/mysql-5.1-runtime
parents
c4e977ce
92b3a32b
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
60 additions
and
11 deletions
+60
-11
include/my_time.h
include/my_time.h
+2
-0
sql/event_data_objects.cc
sql/event_data_objects.cc
+21
-6
sql/event_db_repository.cc
sql/event_db_repository.cc
+5
-5
sql/mysql_priv.h
sql/mysql_priv.h
+2
-0
sql/strfunc.cc
sql/strfunc.cc
+30
-0
No files found.
include/my_time.h
View file @
14cf209a
...
...
@@ -100,6 +100,8 @@ int my_TIME_to_str(const MYSQL_TIME *l_time, char *to);
/*
The following must be sorted so that simple intervals comes first.
(get_interval_value() depends on this)
When updating this enum please update
LEX_STRING interval_type_to_name[] in sql/time.cc
*/
enum
interval_type
...
...
sql/event_data_objects.cc
View file @
14cf209a
...
...
@@ -886,14 +886,29 @@ Event_queue_element::load_from_row(TABLE *table)
goto
error
;
/*
In DB the values start from 1 but enum interval_type starts
from 0
We load the interval type from disk as string and then map it to
an integer. This decouples the values of enum interval_type
and values actually stored on disk. Therefore the type can be
reordered without risking incompatibilities of data between versions.
*/
if
(
!
table
->
field
[
ET_FIELD_TRANSIENT_INTERVAL
]
->
is_null
())
interval
=
(
interval_type
)
((
ulonglong
)
table
->
field
[
ET_FIELD_TRANSIENT_INTERVAL
]
->
val_int
()
-
1
);
else
interval
=
(
interval_type
)
0
;
{
int
i
;
char
buff
[
MAX_FIELD_WIDTH
];
String
str
(
buff
,
sizeof
(
buff
),
&
my_charset_bin
);
LEX_STRING
tmp
;
table
->
field
[
ET_FIELD_TRANSIENT_INTERVAL
]
->
val_str
(
&
str
);
if
(
!
(
tmp
.
length
=
str
.
length
()))
goto
error
;
tmp
.
str
=
str
.
c_ptr_safe
();
i
=
find_string_in_array
(
interval_type_to_name
,
&
tmp
,
system_charset_info
);
if
(
i
<
0
)
goto
error
;
interval
=
(
interval_type
)
i
;
}
table
->
field
[
ET_FIELD_LAST_EXECUTED
]
->
get_date
(
&
last_executed
,
TIME_NO_ZERO_DATE
);
...
...
sql/event_db_repository.cc
View file @
14cf209a
...
...
@@ -188,11 +188,11 @@ mysql_event_fill_row(THD *thd, TABLE *table, Event_parse_data *et,
fields
[
ET_FIELD_INTERVAL_EXPR
]
->
store
((
longlong
)
et
->
expression
,
TRUE
);
fields
[
ET_FIELD_TRANSIENT_INTERVAL
]
->
set_notnull
();
/*
In the enum (C) intervals start from 0 but in mysql enum valid values
start from 1. Thus +1 offset is needed!
*/
fields
[
ET_FIELD_TRANSIENT_INTERVAL
]
->
store
((
longlong
)
et
->
interval
+
1
,
TRUE
);
fields
[
ET_FIELD_TRANSIENT_INTERVAL
]
->
store
(
interval_type_to_name
[
et
->
interval
].
str
,
interval_type_to_name
[
et
->
interval
].
length
,
scs
);
fields
[
ET_FIELD_EXECUTE_AT
]
->
set_null
();
...
...
sql/mysql_priv.h
View file @
14cf209a
...
...
@@ -1481,6 +1481,8 @@ uint find_type2(TYPELIB *lib, const char *find, uint length, CHARSET_INFO *cs);
void
unhex_type2
(
TYPELIB
*
lib
);
uint
check_word
(
TYPELIB
*
lib
,
const
char
*
val
,
const
char
*
end
,
const
char
**
end_of_word
);
int
find_string_in_array
(
LEX_STRING
*
const
haystack
,
LEX_STRING
*
const
needle
,
CHARSET_INFO
*
cs
);
bool
is_keyword
(
const
char
*
name
,
uint
len
);
...
...
sql/strfunc.cc
View file @
14cf209a
...
...
@@ -312,3 +312,33 @@ uint strconvert(CHARSET_INFO *from_cs, const char *from,
return
(
uint32
)
(
to
-
to_start
);
}
/*
Searches for a LEX_STRING in an LEX_STRING array.
SYNOPSIS
find_string_in_array()
heap The array
needle The string to search for
NOTE
The last LEX_STRING in the array should have str member set to NULL
RETURN VALUES
-1 Not found
>=0 Ordinal position
*/
int
find_string_in_array
(
LEX_STRING
*
const
haystack
,
LEX_STRING
*
const
needle
,
CHARSET_INFO
*
const
cs
)
{
const
LEX_STRING
*
pos
;
for
(
pos
=
haystack
;
pos
->
str
;
pos
++
)
if
(
!
cs
->
coll
->
strnncollsp
(
cs
,
(
uchar
*
)
pos
->
str
,
pos
->
length
,
(
uchar
*
)
needle
->
str
,
needle
->
length
,
0
))
{
return
(
pos
-
haystack
);
}
return
-
1
;
}
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