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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
f887a956
Commit
f887a956
authored
Feb 10, 2013
by
Antony T Curtis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Const correctness and include dependency fixes.
parent
98e1bc25
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
55 additions
and
44 deletions
+55
-44
sql/create_options.cc
sql/create_options.cc
+3
-3
sql/create_options.h
sql/create_options.h
+1
-1
sql/handler.h
sql/handler.h
+3
-3
sql/item_func.cc
sql/item_func.cc
+43
-0
sql/item_func.h
sql/item_func.h
+5
-37
No files found.
sql/create_options.cc
View file @
f887a956
...
...
@@ -114,7 +114,7 @@ static bool report_unknown_option(THD *thd, engine_option_value *val,
DBUG_RETURN
(
FALSE
);
}
static
bool
set_one_value
(
ha_create_table_option
*
opt
,
static
bool
set_one_value
(
const
ha_create_table_option
*
opt
,
THD
*
thd
,
LEX_STRING
*
value
,
void
*
base
,
my_bool
suppress_warning
,
MEM_ROOT
*
root
)
...
...
@@ -259,11 +259,11 @@ static const size_t ha_option_type_sizeof[]=
my_bool
parse_option_list
(
THD
*
thd
,
void
*
option_struct_arg
,
engine_option_value
*
option_list
,
ha_create_table_option
*
rules
,
const
ha_create_table_option
*
rules
,
my_bool
suppress_warning
,
MEM_ROOT
*
root
)
{
ha_create_table_option
*
opt
;
const
ha_create_table_option
*
opt
;
size_t
option_struct_size
=
0
;
engine_option_value
*
val
=
option_list
;
void
**
option_struct
=
(
void
**
)
option_struct_arg
;
...
...
sql/create_options.h
View file @
f887a956
...
...
@@ -73,7 +73,7 @@ my_bool parse_engine_table_options(THD *thd, handlerton *ht,
TABLE_SHARE
*
share
);
my_bool
parse_option_list
(
THD
*
thd
,
void
*
option_struct
,
engine_option_value
*
option_list
,
ha_create_table_option
*
rules
,
const
ha_create_table_option
*
rules
,
my_bool
suppress_warning
,
MEM_ROOT
*
root
);
my_bool
engine_table_options_frm_read
(
const
uchar
*
buff
,
...
...
sql/handler.h
View file @
f887a956
...
...
@@ -1053,9 +1053,9 @@ struct handlerton
/*
Optional clauses in the CREATE/ALTER TABLE
*/
ha_create_table_option
*
table_options
;
// table level options
ha_create_table_option
*
field_options
;
// these are specified per field
ha_create_table_option
*
index_options
;
// these are specified per index
const
ha_create_table_option
*
table_options
;
// table level options
const
ha_create_table_option
*
field_options
;
// these are specified per field
const
ha_create_table_option
*
index_options
;
// these are specified per index
};
...
...
sql/item_func.cc
View file @
f887a956
...
...
@@ -3592,6 +3592,23 @@ void Item_udf_func::print(String *str, enum_query_type query_type)
}
longlong
Item_func_udf_float
::
val_int
()
{
DBUG_ASSERT
(
fixed
==
1
);
return
(
longlong
)
rint
(
Item_func_udf_float
::
val_real
());
}
my_decimal
*
Item_func_udf_float
::
val_decimal
(
my_decimal
*
dec_buf
)
{
double
res
=
val_real
();
if
(
null_value
)
return
NULL
;
double2my_decimal
(
E_DEC_FATAL_ERROR
,
res
,
dec_buf
);
return
dec_buf
;
}
double
Item_func_udf_float
::
val_real
()
{
double
res
;
...
...
@@ -3721,6 +3738,32 @@ String *Item_func_udf_str::val_str(String *str)
return
res
;
}
double
Item_func_udf_str
::
val_real
()
{
int
err_not_used
;
char
*
end_not_used
;
String
*
res
;
res
=
val_str
(
&
str_value
);
return
res
?
my_strntod
(
res
->
charset
(),(
char
*
)
res
->
ptr
(),
res
->
length
(),
&
end_not_used
,
&
err_not_used
)
:
0.0
;
}
longlong
Item_func_udf_str
::
val_int
()
{
int
err_not_used
;
String
*
res
;
res
=
val_str
(
&
str_value
);
return
res
?
my_strntoll
(
res
->
charset
(),
res
->
ptr
(),
res
->
length
(),
10
,
(
char
**
)
0
,
&
err_not_used
)
:
(
longlong
)
0
;
}
my_decimal
*
Item_func_udf_str
::
val_decimal
(
my_decimal
*
dec_buf
)
{
String
*
res
=
val_str
(
&
str_value
);
if
(
!
res
)
return
NULL
;
string2my_decimal
(
E_DEC_FATAL_ERROR
,
res
,
dec_buf
);
return
dec_buf
;
}
/**
@note
...
...
sql/item_func.h
View file @
f887a956
...
...
@@ -1358,19 +1358,8 @@ class Item_func_udf_float :public Item_udf_func
Item_func_udf_float
(
udf_func
*
udf_arg
,
List
<
Item
>
&
list
)
:
Item_udf_func
(
udf_arg
,
list
)
{}
longlong
val_int
()
{
DBUG_ASSERT
(
fixed
==
1
);
return
(
longlong
)
rint
(
Item_func_udf_float
::
val_real
());
}
my_decimal
*
val_decimal
(
my_decimal
*
dec_buf
)
{
double
res
=
val_real
();
if
(
null_value
)
return
NULL
;
double2my_decimal
(
E_DEC_FATAL_ERROR
,
res
,
dec_buf
);
return
dec_buf
;
}
longlong
val_int
();
my_decimal
*
val_decimal
(
my_decimal
*
dec_buf
);
double
val_real
();
String
*
val_str
(
String
*
str
);
void
fix_length_and_dec
()
{
fix_num_length_and_dec
();
}
...
...
@@ -1417,30 +1406,9 @@ public:
Item_func_udf_str
(
udf_func
*
udf_arg
,
List
<
Item
>
&
list
)
:
Item_udf_func
(
udf_arg
,
list
)
{}
String
*
val_str
(
String
*
);
double
val_real
()
{
int
err_not_used
;
char
*
end_not_used
;
String
*
res
;
res
=
val_str
(
&
str_value
);
return
res
?
my_strntod
(
res
->
charset
(),(
char
*
)
res
->
ptr
(),
res
->
length
(),
&
end_not_used
,
&
err_not_used
)
:
0.0
;
}
longlong
val_int
()
{
int
err_not_used
;
String
*
res
;
res
=
val_str
(
&
str_value
);
return
res
?
my_strntoll
(
res
->
charset
(),
res
->
ptr
(),
res
->
length
(),
10
,
(
char
**
)
0
,
&
err_not_used
)
:
(
longlong
)
0
;
}
my_decimal
*
val_decimal
(
my_decimal
*
dec_buf
)
{
String
*
res
=
val_str
(
&
str_value
);
if
(
!
res
)
return
NULL
;
string2my_decimal
(
E_DEC_FATAL_ERROR
,
res
,
dec_buf
);
return
dec_buf
;
}
double
val_real
();
longlong
val_int
();
my_decimal
*
val_decimal
(
my_decimal
*
dec_buf
);
enum
Item_result
result_type
()
const
{
return
STRING_RESULT
;
}
void
fix_length_and_dec
();
};
...
...
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