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
63a497a1
Commit
63a497a1
authored
Nov 06, 2005
by
ramil@poseidon.ndb.mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1. sys_variables[] array is removed.
2. All have_xxx variables are now selectable.
parent
41271735
Changes
5
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
95 additions
and
237 deletions
+95
-237
sql/set_var.cc
sql/set_var.cc
+55
-231
sql/set_var.h
sql/set_var.h
+35
-2
sql/sql_lex.cc
sql/sql_lex.cc
+2
-1
sql/sql_lex.h
sql/sql_lex.h
+1
-1
sql/sql_yacc.yy
sql/sql_yacc.yy
+2
-2
No files found.
sql/set_var.cc
View file @
63a497a1
This diff is collapsed.
Click to expand it.
sql/set_var.h
View file @
63a497a1
...
@@ -39,6 +39,9 @@ typedef byte *(*sys_value_ptr_func)(THD *thd);
...
@@ -39,6 +39,9 @@ typedef byte *(*sys_value_ptr_func)(THD *thd);
class
sys_var
class
sys_var
{
{
public:
public:
static
sys_var
*
first
;
static
uint
sys_vars
;
sys_var
*
next
;
struct
my_option
*
option_limits
;
/* Updated by by set_var_init() */
struct
my_option
*
option_limits
;
/* Updated by by set_var_init() */
uint
name_length
;
/* Updated by by set_var_init() */
uint
name_length
;
/* Updated by by set_var_init() */
const
char
*
name
;
const
char
*
name
;
...
@@ -48,12 +51,18 @@ class sys_var
...
@@ -48,12 +51,18 @@ class sys_var
sys_var
(
const
char
*
name_arg
)
sys_var
(
const
char
*
name_arg
)
:
name
(
name_arg
),
after_update
(
0
)
:
name
(
name_arg
),
after_update
(
0
)
,
no_support_one_shot
(
1
)
,
no_support_one_shot
(
1
)
{
}
{
add_sys_var
();
}
sys_var
(
const
char
*
name_arg
,
sys_after_update_func
func
)
sys_var
(
const
char
*
name_arg
,
sys_after_update_func
func
)
:
name
(
name_arg
),
after_update
(
func
)
:
name
(
name_arg
),
after_update
(
func
)
,
no_support_one_shot
(
1
)
,
no_support_one_shot
(
1
)
{}
{
add_sys_var
();
}
virtual
~
sys_var
()
{}
virtual
~
sys_var
()
{}
void
add_sys_var
()
{
next
=
first
;
first
=
this
;
sys_vars
++
;
}
virtual
bool
check
(
THD
*
thd
,
set_var
*
var
);
virtual
bool
check
(
THD
*
thd
,
set_var
*
var
);
bool
check_enum
(
THD
*
thd
,
set_var
*
var
,
TYPELIB
*
enum_names
);
bool
check_enum
(
THD
*
thd
,
set_var
*
var
,
TYPELIB
*
enum_names
);
bool
check_set
(
THD
*
thd
,
set_var
*
var
,
TYPELIB
*
enum_names
);
bool
check_set
(
THD
*
thd
,
set_var
*
var
,
TYPELIB
*
enum_names
);
...
@@ -701,6 +710,30 @@ class sys_var_readonly: public sys_var
...
@@ -701,6 +710,30 @@ class sys_var_readonly: public sys_var
bool
is_readonly
()
const
{
return
1
;
}
bool
is_readonly
()
const
{
return
1
;
}
};
};
class
sys_var_have_variable
:
public
sys_var
{
SHOW_COMP_OPTION
*
have_variable
;
public:
sys_var_have_variable
(
const
char
*
variable_name
,
SHOW_COMP_OPTION
*
have_variable_arg
)
:
sys_var
(
variable_name
),
have_variable
(
have_variable_arg
)
{
}
byte
*
value_ptr
(
THD
*
thd
,
enum_var_type
type
,
LEX_STRING
*
base
)
{
return
(
byte
*
)
show_comp_option_name
[
*
have_variable
];
}
bool
update
(
THD
*
thd
,
set_var
*
var
)
{
return
1
;
}
bool
check_default
(
enum_var_type
type
)
{
return
1
;
}
bool
check_type
(
enum_var_type
type
)
{
return
type
!=
OPT_GLOBAL
;
}
bool
check_update_type
(
Item_result
type
)
{
return
1
;
}
SHOW_TYPE
type
()
{
return
SHOW_CHAR
;
}
bool
is_readonly
()
const
{
return
1
;
}
};
class
sys_var_thd_time_zone
:
public
sys_var_thd
class
sys_var_thd_time_zone
:
public
sys_var_thd
{
{
public:
public:
...
...
sql/sql_lex.cc
View file @
63a497a1
...
@@ -28,7 +28,8 @@
...
@@ -28,7 +28,8 @@
We are using pointer to this variable for distinguishing between assignment
We are using pointer to this variable for distinguishing between assignment
to NEW row field (when parsing trigger definition) and structured variable.
to NEW row field (when parsing trigger definition) and structured variable.
*/
*/
sys_var_long_ptr
trg_new_row_fake_var
(
0
,
0
);
sys_var
*
trg_new_row_fake_var
=
(
sys_var
*
)
0x01
;
/* Macros to look like lex */
/* Macros to look like lex */
...
...
sql/sql_lex.h
View file @
63a497a1
...
@@ -702,7 +702,7 @@ struct st_trg_chistics
...
@@ -702,7 +702,7 @@ struct st_trg_chistics
enum
trg_event_type
event
;
enum
trg_event_type
event
;
};
};
extern
sys_var
_long_ptr
trg_new_row_fake_var
;
extern
sys_var
*
trg_new_row_fake_var
;
enum
xa_option_words
{
XA_NONE
,
XA_JOIN
,
XA_RESUME
,
XA_ONE_PHASE
,
enum
xa_option_words
{
XA_NONE
,
XA_JOIN
,
XA_RESUME
,
XA_ONE_PHASE
,
XA_SUSPEND
,
XA_FOR_MIGRATE
};
XA_SUSPEND
,
XA_FOR_MIGRATE
};
...
...
sql/sql_yacc.yy
View file @
63a497a1
...
@@ -8529,7 +8529,7 @@ sys_option_value:
...
@@ -8529,7 +8529,7 @@ sys_option_value:
{
{
LEX *lex=Lex;
LEX *lex=Lex;
if ($2.var ==
&
trg_new_row_fake_var)
if ($2.var == trg_new_row_fake_var)
{
{
/* We are in trigger and assigning value to field of new row */
/* We are in trigger and assigning value to field of new row */
Item *it;
Item *it;
...
@@ -8750,7 +8750,7 @@ internal_variable_name:
...
@@ -8750,7 +8750,7 @@ internal_variable_name:
YYABORT;
YYABORT;
}
}
/* This special combination will denote field of NEW row */
/* This special combination will denote field of NEW row */
$$.var=
&
trg_new_row_fake_var;
$$.var= trg_new_row_fake_var;
$$.base_name= $3;
$$.base_name= $3;
}
}
else
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