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
3cd5a23f
Commit
3cd5a23f
authored
Dec 28, 2005
by
andrey@lmy004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WL #1034 update
- fix problem with too long identifier name
parent
02983835
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
42 additions
and
16 deletions
+42
-16
sql/event.cc
sql/event.cc
+35
-10
sql/event_priv.h
sql/event_priv.h
+4
-3
sql/share/errmsg.txt
sql/share/errmsg.txt
+2
-0
sql/sql_yacc.yy
sql/sql_yacc.yy
+1
-3
No files found.
sql/event.cc
View file @
3cd5a23f
...
...
@@ -211,6 +211,11 @@ evex_db_find_event_aux(THD *thd, const LEX_STRING dbname,
table the row to fill out
et Event's data
Returns
0 - ok
EVEX_GENERAL_ERROR - bad data
EVEX_GET_FIELD_FAILED - field count does not match. table corrupted?
DESCRIPTION
Used both when an event is created and when it is altered.
*/
...
...
@@ -218,6 +223,8 @@ evex_db_find_event_aux(THD *thd, const LEX_STRING dbname,
static
int
evex_fill_row
(
THD
*
thd
,
TABLE
*
table
,
event_timed
*
et
,
my_bool
is_update
)
{
enum
evex_table_field
field_num
;
DBUG_ENTER
(
"evex_fill_row"
);
if
(
table
->
s
->
fields
!=
EVEX_FIELD_COUNT
)
...
...
@@ -229,10 +236,13 @@ evex_fill_row(THD *thd, TABLE *table, event_timed *et, my_bool is_update)
DBUG_PRINT
(
"info"
,
(
"dbname.len=%d"
,
et
->
dbname
.
length
));
DBUG_PRINT
(
"info"
,
(
"name.len=%d"
,
et
->
name
.
length
));
table
->
field
[
EVEX_FIELD_DB
]
->
store
(
et
->
dbname
.
str
,
et
->
dbname
.
length
,
system_charset_info
);
table
->
field
[
EVEX_FIELD_NAME
]
->
store
(
et
->
name
.
str
,
et
->
name
.
length
,
system_charset_info
);
if
(
table
->
field
[
field_num
=
EVEX_FIELD_DB
]
->
store
(
et
->
dbname
.
str
,
et
->
dbname
.
length
,
system_charset_info
))
goto
trunc_err
;
if
(
table
->
field
[
field_num
=
EVEX_FIELD_NAME
]
->
store
(
et
->
name
.
str
,
et
->
name
.
length
,
system_charset_info
))
goto
trunc_err
;
table
->
field
[
EVEX_FIELD_ON_COMPLETION
]
->
set_notnull
();
table
->
field
[
EVEX_FIELD_ON_COMPLETION
]
->
store
((
longlong
)
et
->
on_completion
);
...
...
@@ -243,8 +253,9 @@ evex_fill_row(THD *thd, TABLE *table, event_timed *et, my_bool is_update)
// ToDo: Andrey. How to use users current charset?
if
(
et
->
body
.
str
)
table
->
field
[
EVEX_FIELD_BODY
]
->
store
(
et
->
body
.
str
,
et
->
body
.
length
,
system_charset_info
);
if
(
table
->
field
[
field_num
=
EVEX_FIELD_BODY
]
->
store
(
et
->
body
.
str
,
et
->
body
.
length
,
system_charset_info
))
goto
trunc_err
;
if
(
et
->
starts
.
year
)
{
...
...
@@ -290,10 +301,14 @@ evex_fill_row(THD *thd, TABLE *table, event_timed *et, my_bool is_update)
((
Field_timestamp
*
)
table
->
field
[
EVEX_FIELD_MODIFIED
])
->
set_time
();
if
(
et
->
comment
.
length
)
table
->
field
[
EVEX_FIELD_COMMENT
]
->
store
(
et
->
comment
.
str
,
et
->
comment
.
length
,
system_charset_info
);
if
(
table
->
field
[
field_num
=
EVEX_FIELD_COMMENT
]
->
store
(
et
->
comment
.
str
,
et
->
comment
.
length
,
system_charset_info
))
goto
trunc_err
;
DBUG_RETURN
(
0
);
trunc_err:
my_error
(
ER_EVENT_DATA_TOO_LONG
,
MYF
(
0
));
DBUG_RETURN
(
EVEX_GENERAL_ERROR
);
}
...
...
@@ -353,11 +368,21 @@ db_create_event(THD *thd, event_timed *et, my_bool create_if_not,
restore_record
(
table
,
s
->
default_values
);
// Get default values for fields
if
(
et
->
name
.
length
>
table
->
field
[
EVEX_FIELD_NAME
]
->
field_length
)
if
(
system_charset_info
->
cset
->
numchars
(
system_charset_info
,
et
->
dbname
.
str
,
et
->
dbname
.
str
+
et
->
dbname
.
length
)
>
EVEX_DB_FIELD_LEN
)
{
my_error
(
ER_TOO_LONG_IDENT
,
MYF
(
0
),
et
->
dbname
.
str
);
goto
err
;
}
if
(
system_charset_info
->
cset
->
numchars
(
system_charset_info
,
et
->
name
.
str
,
et
->
name
.
str
+
et
->
name
.
length
)
>
EVEX_DB_FIELD_LEN
)
{
my_error
(
ER_TOO_LONG_IDENT
,
MYF
(
0
),
et
->
name
.
str
);
goto
err
;
}
if
(
et
->
body
.
length
>
table
->
field
[
EVEX_FIELD_BODY
]
->
field_length
)
{
my_error
(
ER_TOO_LONG_BODY
,
MYF
(
0
),
et
->
name
.
str
);
...
...
sql/event_priv.h
View file @
3cd5a23f
...
...
@@ -24,7 +24,7 @@
#define UNLOCK_MUTEX_AND_BAIL_OUT(__mutex, __label) \
{ VOID(pthread_mutex_unlock(&__mutex)); goto __label; }
enum
enum
evex_table_field
{
EVEX_FIELD_DB
=
0
,
EVEX_FIELD_NAME
,
...
...
@@ -42,9 +42,10 @@ enum
EVEX_FIELD_ON_COMPLETION
,
EVEX_FIELD_COMMENT
,
EVEX_FIELD_COUNT
/* a cool trick to count the number of fields :) */
};
}
;
#define EVEX_DB_FIELD_LEN 64
#define EVEX_NAME_FIELD_LEN 64
int
my_time_compare
(
TIME
*
a
,
TIME
*
b
);
...
...
sql/share/errmsg.txt
View file @
3cd5a23f
...
...
@@ -5751,3 +5751,5 @@ ER_EVENT_COMPILE_ERROR
eng "Error during compilation of event's body"
ER_EVENT_SAME_NAME
eng "Same old and new event name"
ER_EVENT_DATA_TOO_LONG
eng "Data for column '%s' too long"
sql/sql_yacc.yy
View file @
3cd5a23f
...
...
@@ -4275,8 +4275,6 @@ alter:
sql_command is set here because some rules in ev_sql_stmt
can overwrite it
*/
printf("5=%d 6=%d 7=%d 8=%d 9=%d 10=%d", $<ulong_num>5 , $<ulong_num>6 , $<ulong_num>7 ,
$<ulong_num>8 , $<ulong_num>9 , $<ulong_num>10);
if (!($<ulong_num>5 || $<ulong_num>6 || $<ulong_num>7 ||
$<ulong_num>8 || $<ulong_num>9 || $<ulong_num>10))
{
...
...
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