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
674994b0
Commit
674994b0
authored
Jul 21, 2006
by
mikael/pappa@dator5.(none)
Browse files
Options
Browse Files
Download
Plain Diff
Merge dator5.(none):/home/pappa/clean-mysql-5.1
into dator5.(none):/home/pappa/bug18198
parents
84f3623b
032d208b
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
244 additions
and
141 deletions
+244
-141
mysql-test/r/partition.result
mysql-test/r/partition.result
+1
-1
mysql-test/r/partition_error.result
mysql-test/r/partition_error.result
+17
-0
mysql-test/t/partition.test
mysql-test/t/partition.test
+1
-1
mysql-test/t/partition_error.test
mysql-test/t/partition_error.test
+22
-0
sql/item.h
sql/item.h
+25
-21
sql/item_cmpfunc.h
sql/item_cmpfunc.h
+15
-15
sql/item_func.h
sql/item_func.h
+30
-31
sql/item_strfunc.h
sql/item_strfunc.h
+14
-24
sql/item_timefunc.h
sql/item_timefunc.h
+30
-30
sql/item_xmlfunc.h
sql/item_xmlfunc.h
+1
-1
sql/partition_info.cc
sql/partition_info.cc
+27
-11
sql/partition_info.h
sql/partition_info.h
+2
-1
sql/sql_partition.cc
sql/sql_partition.cc
+48
-2
sql/sql_table.cc
sql/sql_table.cc
+2
-1
sql/sql_yacc.yy
sql/sql_yacc.yy
+9
-2
No files found.
mysql-test/r/partition.result
View file @
674994b0
...
@@ -756,7 +756,7 @@ t2 CREATE TABLE `t2` (
...
@@ -756,7 +756,7 @@ t2 CREATE TABLE `t2` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='no comment' /*!50100 PARTITION BY KEY (a) */
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='no comment' /*!50100 PARTITION BY KEY (a) */
drop table t2;
drop table t2;
create table t1 (s1 char(2) character set utf8)
create table t1 (s1 char(2) character set utf8)
partition by list (cas
e when s1 > 'cz' then 1 else 2 end
)
partition by list (cas
t(s1 as signed)
)
(partition p1 values in (1),
(partition p1 values in (1),
partition p2 values in (2));
partition p2 values in (2));
drop table t1;
drop table t1;
...
...
mysql-test/r/partition_error.result
View file @
674994b0
drop table if exists t1;
drop table if exists t1;
create table t1 (a int)
create table t1 (a int)
partition by range (a)
(partition p0 values less than ((select count(*) from t1)));
ERROR HY000: This partition function is not allowed
create table t1 (a int)
partition by range (a)
(partition p0 values less than (a);
ERROR 42S22: Unknown column 'a' in 'partition function'
create table t1 (a int)
partition by range (a)
(partition p0 values less than (1));
alter table t1 add partition (partition p1 values less than (a));
ERROR 42S22: Unknown column 'a' in 'partition function'
alter table t1 add partition
(partition p1 values less than ((select count(*) from t1)));
ERROR HY000: This partition function is not allowed
drop table t1;
create table t1 (a int)
engine = x
engine = x
partition by key (a);
partition by key (a);
Warnings:
Warnings:
...
...
mysql-test/t/partition.test
View file @
674994b0
...
@@ -891,7 +891,7 @@ drop table t2;
...
@@ -891,7 +891,7 @@ drop table t2;
# Bug#14367: Partitions: crash if utf8 column
# Bug#14367: Partitions: crash if utf8 column
#
#
create
table
t1
(
s1
char
(
2
)
character
set
utf8
)
create
table
t1
(
s1
char
(
2
)
character
set
utf8
)
partition
by
list
(
cas
e
when
s1
>
'cz'
then
1
else
2
end
)
partition
by
list
(
cas
t
(
s1
as
signed
)
)
(
partition
p1
values
in
(
1
),
(
partition
p1
values
in
(
1
),
partition
p2
values
in
(
2
));
partition
p2
values
in
(
2
));
drop
table
t1
;
drop
table
t1
;
...
...
mysql-test/t/partition_error.test
View file @
674994b0
...
@@ -8,6 +8,28 @@
...
@@ -8,6 +8,28 @@
drop
table
if
exists
t1
;
drop
table
if
exists
t1
;
--
enable_warnings
--
enable_warnings
#
# Bug 18198: Partitions: Too flexible functions
#
--
error
ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
create
table
t1
(
a
int
)
partition
by
range
(
a
)
(
partition
p0
values
less
than
((
select
count
(
*
)
from
t1
)));
--
error
1054
create
table
t1
(
a
int
)
partition
by
range
(
a
)
(
partition
p0
values
less
than
(
a
);
create
table
t1
(
a
int
)
partition
by
range
(
a
)
(
partition
p0
values
less
than
(
1
));
--
error
1054
alter
table
t1
add
partition
(
partition
p1
values
less
than
(
a
));
--
error
ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
alter
table
t1
add
partition
(
partition
p1
values
less
than
((
select
count
(
*
)
from
t1
)));
drop
table
t1
;
#
#
# Bug 20397: Partitions: Crash when using non-existing engine
# Bug 20397: Partitions: Crash when using non-existing engine
#
#
...
...
sql/item.h
View file @
674994b0
...
@@ -789,7 +789,7 @@ public:
...
@@ -789,7 +789,7 @@ public:
Check if a partition function is allowed
Check if a partition function is allowed
SYNOPSIS
SYNOPSIS
check_partition_func_processor()
check_partition_func_processor()
bool
_arg Return argument
int
_arg Return argument
RETURN VALUE
RETURN VALUE
0
0
DESCRIPTION
DESCRIPTION
...
@@ -806,8 +806,12 @@ public:
...
@@ -806,8 +806,12 @@ public:
whether this should be inherited to the new class. If not the function
whether this should be inherited to the new class. If not the function
below should be defined in the new Item class.
below should be defined in the new Item class.
*/
*/
virtual
bool
check_partition_func_processor
(
byte
*
bool_arg
)
{
*
(
bool
*
)
bool_arg
=
FALSE
;
return
0
;
}
virtual
bool
check_partition_func_processor
(
byte
*
int_arg
)
{
*
(
int
*
)
int_arg
=
0
;
return
FALSE
;
}
virtual
Item
*
equal_fields_propagator
(
byte
*
arg
)
{
return
this
;
}
virtual
Item
*
equal_fields_propagator
(
byte
*
arg
)
{
return
this
;
}
virtual
Item
*
set_no_const_sub
(
byte
*
arg
)
{
return
this
;
}
virtual
Item
*
set_no_const_sub
(
byte
*
arg
)
{
return
this
;
}
...
@@ -1099,7 +1103,7 @@ public:
...
@@ -1099,7 +1103,7 @@ public:
Item
::
maybe_null
=
TRUE
;
Item
::
maybe_null
=
TRUE
;
}
}
bool
check_partition_func_processor
(
byte
*
bool_arg
)
{
return
0
;
}
bool
check_partition_func_processor
(
byte
*
int_arg
)
{
return
FALSE
;
}
bool
fix_fields
(
THD
*
,
Item
**
);
bool
fix_fields
(
THD
*
,
Item
**
);
enum
Type
type
()
const
;
enum
Type
type
()
const
;
...
@@ -1145,7 +1149,7 @@ public:
...
@@ -1145,7 +1149,7 @@ public:
Item_num
()
{}
/* Remove gcc warning */
Item_num
()
{}
/* Remove gcc warning */
virtual
Item_num
*
neg
()
=
0
;
virtual
Item_num
*
neg
()
=
0
;
Item
*
safe_charset_converter
(
CHARSET_INFO
*
tocs
);
Item
*
safe_charset_converter
(
CHARSET_INFO
*
tocs
);
bool
check_partition_func_processor
(
byte
*
bool_arg
)
{
return
0
;}
bool
check_partition_func_processor
(
byte
*
int_arg
)
{
return
FALSE
;}
};
};
#define NO_CACHED_FIELD_INDEX ((uint)(-1))
#define NO_CACHED_FIELD_INDEX ((uint)(-1))
...
@@ -1303,7 +1307,7 @@ public:
...
@@ -1303,7 +1307,7 @@ public:
bool
collect_item_field_processor
(
byte
*
arg
);
bool
collect_item_field_processor
(
byte
*
arg
);
bool
find_item_in_field_list_processor
(
byte
*
arg
);
bool
find_item_in_field_list_processor
(
byte
*
arg
);
bool
register_field_in_read_map
(
byte
*
arg
);
bool
register_field_in_read_map
(
byte
*
arg
);
bool
check_partition_func_processor
(
byte
*
bool_arg
)
{
return
0
;
}
bool
check_partition_func_processor
(
byte
*
int_arg
)
{
return
FALSE
;
}
void
cleanup
();
void
cleanup
();
bool
result_as_longlong
()
bool
result_as_longlong
()
{
{
...
@@ -1351,7 +1355,7 @@ public:
...
@@ -1351,7 +1355,7 @@ public:
bool
is_null
()
{
return
1
;
}
bool
is_null
()
{
return
1
;
}
void
print
(
String
*
str
)
{
str
->
append
(
STRING_WITH_LEN
(
"NULL"
));
}
void
print
(
String
*
str
)
{
str
->
append
(
STRING_WITH_LEN
(
"NULL"
));
}
Item
*
safe_charset_converter
(
CHARSET_INFO
*
tocs
);
Item
*
safe_charset_converter
(
CHARSET_INFO
*
tocs
);
bool
check_partition_func_processor
(
byte
*
bool_arg
)
{
return
0
;}
bool
check_partition_func_processor
(
byte
*
int_arg
)
{
return
FALSE
;}
};
};
class
Item_null_result
:
public
Item_null
class
Item_null_result
:
public
Item_null
...
@@ -1364,8 +1368,8 @@ public:
...
@@ -1364,8 +1368,8 @@ public:
{
{
save_in_field
(
result_field
,
no_conversions
);
save_in_field
(
result_field
,
no_conversions
);
}
}
bool
check_partition_func_processor
(
byte
*
bool
_arg
)
bool
check_partition_func_processor
(
byte
*
int
_arg
)
{
*
(
bool
*
)
bool_arg
=
FALSE
;
return
0
;
}
{
*
(
int
*
)
int_arg
=
0
;
return
FALSE
;
}
};
};
/* Item represents one placeholder ('?') of prepared statement */
/* Item represents one placeholder ('?') of prepared statement */
...
@@ -1656,8 +1660,8 @@ public:
...
@@ -1656,8 +1660,8 @@ public:
{}
{}
void
print
(
String
*
str
)
{
str
->
append
(
func_name
);
}
void
print
(
String
*
str
)
{
str
->
append
(
func_name
);
}
Item
*
safe_charset_converter
(
CHARSET_INFO
*
tocs
);
Item
*
safe_charset_converter
(
CHARSET_INFO
*
tocs
);
bool
check_partition_func_processor
(
byte
*
bool
_arg
)
bool
check_partition_func_processor
(
byte
*
int
_arg
)
{
*
(
bool
*
)
bool_arg
=
FALSE
;
return
0
;
}
{
*
(
int
*
)
int_arg
=
0
;
return
FALSE
;
}
};
};
...
@@ -1735,7 +1739,7 @@ public:
...
@@ -1735,7 +1739,7 @@ public:
void
print
(
String
*
str
);
void
print
(
String
*
str
);
// to prevent drop fixed flag (no need parent cleanup call)
// to prevent drop fixed flag (no need parent cleanup call)
void
cleanup
()
{}
void
cleanup
()
{}
bool
check_partition_func_processor
(
byte
*
bool_arg
)
{
return
0
;}
bool
check_partition_func_processor
(
byte
*
int_arg
)
{
return
FALSE
;}
};
};
...
@@ -1750,8 +1754,8 @@ public:
...
@@ -1750,8 +1754,8 @@ public:
{}
{}
Item
*
safe_charset_converter
(
CHARSET_INFO
*
tocs
);
Item
*
safe_charset_converter
(
CHARSET_INFO
*
tocs
);
void
print
(
String
*
str
)
{
str
->
append
(
func_name
);
}
void
print
(
String
*
str
)
{
str
->
append
(
func_name
);
}
bool
check_partition_func_processor
(
byte
*
bool
_arg
)
bool
check_partition_func_processor
(
byte
*
int
_arg
)
{
*
(
bool
*
)
bool_arg
=
FALSE
;
return
0
;
}
{
*
(
int
*
)
int_arg
=
0
;
return
FALSE
;
}
};
};
...
@@ -1764,8 +1768,8 @@ public:
...
@@ -1764,8 +1768,8 @@ public:
&
my_charset_bin
)
&
my_charset_bin
)
{
max_length
=
19
;}
{
max_length
=
19
;}
enum_field_types
field_type
()
const
{
return
MYSQL_TYPE_DATETIME
;
}
enum_field_types
field_type
()
const
{
return
MYSQL_TYPE_DATETIME
;
}
bool
check_partition_func_processor
(
byte
*
bool
_arg
)
bool
check_partition_func_processor
(
byte
*
int
_arg
)
{
*
(
bool
*
)
bool_arg
=
FALSE
;
return
0
;
}
{
*
(
int
*
)
int_arg
=
0
;
return
FALSE
;
}
};
};
class
Item_empty_string
:
public
Item_string
class
Item_empty_string
:
public
Item_string
...
@@ -1788,8 +1792,8 @@ public:
...
@@ -1788,8 +1792,8 @@ public:
unsigned_flag
=
1
;
unsigned_flag
=
1
;
}
}
enum_field_types
field_type
()
const
{
return
int_field_type
;
}
enum_field_types
field_type
()
const
{
return
int_field_type
;
}
bool
check_partition_func_processor
(
byte
*
bool
_arg
)
bool
check_partition_func_processor
(
byte
*
int
_arg
)
{
*
(
bool
*
)
bool_arg
=
FALSE
;
return
0
;
}
{
*
(
int
*
)
int_arg
=
0
;
return
FALSE
;
}
};
};
...
@@ -1813,7 +1817,7 @@ public:
...
@@ -1813,7 +1817,7 @@ public:
void
cleanup
()
{}
void
cleanup
()
{}
bool
eq
(
const
Item
*
item
,
bool
binary_cmp
)
const
;
bool
eq
(
const
Item
*
item
,
bool
binary_cmp
)
const
;
virtual
Item
*
safe_charset_converter
(
CHARSET_INFO
*
tocs
);
virtual
Item
*
safe_charset_converter
(
CHARSET_INFO
*
tocs
);
bool
check_partition_func_processor
(
byte
*
bool_arg
)
{
return
0
;
}
bool
check_partition_func_processor
(
byte
*
int_arg
)
{
return
FALSE
;
}
};
};
...
@@ -2040,8 +2044,8 @@ public:
...
@@ -2040,8 +2044,8 @@ public:
}
}
Item
*
new_item
();
Item
*
new_item
();
virtual
Item
*
real_item
()
{
return
ref
;
}
virtual
Item
*
real_item
()
{
return
ref
;
}
bool
check_partition_func_processor
(
byte
*
bool
_arg
)
bool
check_partition_func_processor
(
byte
*
int
_arg
)
{
*
(
bool
*
)
bool_arg
=
FALSE
;
return
0
;
}
{
*
(
int
*
)
int_arg
=
0
;
return
FALSE
;
}
};
};
#ifdef MYSQL_SERVER
#ifdef MYSQL_SERVER
...
...
sql/item_cmpfunc.h
View file @
674994b0
...
@@ -240,7 +240,7 @@ public:
...
@@ -240,7 +240,7 @@ public:
}
}
Item
*
neg_transformer
(
THD
*
thd
);
Item
*
neg_transformer
(
THD
*
thd
);
virtual
Item
*
negated_item
();
virtual
Item
*
negated_item
();
bool
check_partition_func_processor
(
byte
*
bool_arg
)
{
return
0
;
}
bool
check_partition_func_processor
(
byte
*
int_arg
)
{
return
FALSE
;
}
};
};
class
Item_func_not
:
public
Item_bool_func
class
Item_func_not
:
public
Item_bool_func
...
@@ -251,7 +251,7 @@ public:
...
@@ -251,7 +251,7 @@ public:
enum
Functype
functype
()
const
{
return
NOT_FUNC
;
}
enum
Functype
functype
()
const
{
return
NOT_FUNC
;
}
const
char
*
func_name
()
const
{
return
"not"
;
}
const
char
*
func_name
()
const
{
return
"not"
;
}
Item
*
neg_transformer
(
THD
*
thd
);
Item
*
neg_transformer
(
THD
*
thd
);
bool
check_partition_func_processor
(
byte
*
bool_arg
)
{
return
0
;
}
bool
check_partition_func_processor
(
byte
*
int_arg
)
{
return
FALSE
;
}
};
};
class
Item_maxmin_subselect
;
class
Item_maxmin_subselect
;
...
@@ -466,7 +466,7 @@ public:
...
@@ -466,7 +466,7 @@ public:
bool
is_bool_func
()
{
return
1
;
}
bool
is_bool_func
()
{
return
1
;
}
CHARSET_INFO
*
compare_collation
()
{
return
cmp_collation
.
collation
;
}
CHARSET_INFO
*
compare_collation
()
{
return
cmp_collation
.
collation
;
}
uint
decimal_precision
()
const
{
return
1
;
}
uint
decimal_precision
()
const
{
return
1
;
}
bool
check_partition_func_processor
(
byte
*
bool_arg
)
{
return
0
;
}
bool
check_partition_func_processor
(
byte
*
int_arg
)
{
return
FALSE
;
}
};
};
...
@@ -478,7 +478,7 @@ public:
...
@@ -478,7 +478,7 @@ public:
optimize_type
select_optimize
()
const
{
return
OPTIMIZE_NONE
;
}
optimize_type
select_optimize
()
const
{
return
OPTIMIZE_NONE
;
}
const
char
*
func_name
()
const
{
return
"strcmp"
;
}
const
char
*
func_name
()
const
{
return
"strcmp"
;
}
void
print
(
String
*
str
)
{
Item_func
::
print
(
str
);
}
void
print
(
String
*
str
)
{
Item_func
::
print
(
str
);
}
bool
check_partition_func_processor
(
byte
*
bool_arg
)
{
return
0
;
}
bool
check_partition_func_processor
(
byte
*
int_arg
)
{
return
FALSE
;
}
};
};
...
@@ -541,7 +541,7 @@ public:
...
@@ -541,7 +541,7 @@ public:
const
char
*
func_name
()
const
{
return
"ifnull"
;
}
const
char
*
func_name
()
const
{
return
"ifnull"
;
}
Field
*
tmp_table_field
(
TABLE
*
table
);
Field
*
tmp_table_field
(
TABLE
*
table
);
uint
decimal_precision
()
const
;
uint
decimal_precision
()
const
;
bool
check_partition_func_processor
(
byte
*
bool_arg
)
{
return
0
;
}
bool
check_partition_func_processor
(
byte
*
int_arg
)
{
return
FALSE
;
}
};
};
...
@@ -582,7 +582,7 @@ public:
...
@@ -582,7 +582,7 @@ public:
void
print
(
String
*
str
)
{
Item_func
::
print
(
str
);
}
void
print
(
String
*
str
)
{
Item_func
::
print
(
str
);
}
table_map
not_null_tables
()
const
{
return
0
;
}
table_map
not_null_tables
()
const
{
return
0
;
}
bool
is_null
();
bool
is_null
();
bool
check_partition_func_processor
(
byte
*
bool_arg
)
{
return
0
;
}
bool
check_partition_func_processor
(
byte
*
int_arg
)
{
return
FALSE
;
}
};
};
...
@@ -625,7 +625,7 @@ public:
...
@@ -625,7 +625,7 @@ public:
void
print
(
String
*
str
);
void
print
(
String
*
str
);
Item
*
find_item
(
String
*
str
);
Item
*
find_item
(
String
*
str
);
CHARSET_INFO
*
compare_collation
()
{
return
cmp_collation
.
collation
;
}
CHARSET_INFO
*
compare_collation
()
{
return
cmp_collation
.
collation
;
}
bool
check_partition_func_processor
(
byte
*
bool_arg
)
{
return
0
;
}
bool
check_partition_func_processor
(
byte
*
int_arg
)
{
return
FALSE
;
}
};
};
...
@@ -976,7 +976,7 @@ public:
...
@@ -976,7 +976,7 @@ public:
bool
nulls_in_row
();
bool
nulls_in_row
();
bool
is_bool_func
()
{
return
1
;
}
bool
is_bool_func
()
{
return
1
;
}
CHARSET_INFO
*
compare_collation
()
{
return
cmp_collation
.
collation
;
}
CHARSET_INFO
*
compare_collation
()
{
return
cmp_collation
.
collation
;
}
bool
check_partition_func_processor
(
byte
*
bool_arg
)
{
return
0
;
}
bool
check_partition_func_processor
(
byte
*
int_arg
)
{
return
FALSE
;
}
};
};
/* Functions used by where clause */
/* Functions used by where clause */
...
@@ -1018,7 +1018,7 @@ public:
...
@@ -1018,7 +1018,7 @@ public:
optimize_type
select_optimize
()
const
{
return
OPTIMIZE_NULL
;
}
optimize_type
select_optimize
()
const
{
return
OPTIMIZE_NULL
;
}
Item
*
neg_transformer
(
THD
*
thd
);
Item
*
neg_transformer
(
THD
*
thd
);
CHARSET_INFO
*
compare_collation
()
{
return
args
[
0
]
->
collation
.
collation
;
}
CHARSET_INFO
*
compare_collation
()
{
return
args
[
0
]
->
collation
.
collation
;
}
bool
check_partition_func_processor
(
byte
*
bool_arg
)
{
return
0
;
}
bool
check_partition_func_processor
(
byte
*
int_arg
)
{
return
FALSE
;
}
};
};
/* Functions used by HAVING for rewriting IN subquery */
/* Functions used by HAVING for rewriting IN subquery */
...
@@ -1040,8 +1040,8 @@ public:
...
@@ -1040,8 +1040,8 @@ public:
*/
*/
table_map
used_tables
()
const
table_map
used_tables
()
const
{
return
used_tables_cache
|
RAND_TABLE_BIT
;
}
{
return
used_tables_cache
|
RAND_TABLE_BIT
;
}
bool
check_partition_func_processor
(
byte
*
bool
_arg
)
bool
check_partition_func_processor
(
byte
*
int
_arg
)
{
*
(
bool
*
)
bool_arg
=
FALSE
;
return
0
;
}
{
*
(
int
*
)
int_arg
=
0
;
return
FALSE
;
}
};
};
...
@@ -1064,7 +1064,7 @@ public:
...
@@ -1064,7 +1064,7 @@ public:
void
print
(
String
*
str
);
void
print
(
String
*
str
);
CHARSET_INFO
*
compare_collation
()
{
return
args
[
0
]
->
collation
.
collation
;
}
CHARSET_INFO
*
compare_collation
()
{
return
args
[
0
]
->
collation
.
collation
;
}
void
top_level_item
()
{
abort_on_null
=
1
;
}
void
top_level_item
()
{
abort_on_null
=
1
;
}
bool
check_partition_func_processor
(
byte
*
bool_arg
)
{
return
0
;
}
bool
check_partition_func_processor
(
byte
*
int_arg
)
{
return
FALSE
;
}
};
};
...
@@ -1103,7 +1103,7 @@ public:
...
@@ -1103,7 +1103,7 @@ public:
const
char
*
func_name
()
const
{
return
"like"
;
}
const
char
*
func_name
()
const
{
return
"like"
;
}
bool
fix_fields
(
THD
*
thd
,
Item
**
ref
);
bool
fix_fields
(
THD
*
thd
,
Item
**
ref
);
void
cleanup
();
void
cleanup
();
bool
check_partition_func_processor
(
byte
*
bool_arg
)
{
return
0
;
}
bool
check_partition_func_processor
(
byte
*
int_arg
)
{
return
FALSE
;
}
};
};
#ifdef USE_REGEX
#ifdef USE_REGEX
...
@@ -1126,7 +1126,7 @@ public:
...
@@ -1126,7 +1126,7 @@ public:
const
char
*
func_name
()
const
{
return
"regexp"
;
}
const
char
*
func_name
()
const
{
return
"regexp"
;
}
void
print
(
String
*
str
)
{
print_op
(
str
);
}
void
print
(
String
*
str
)
{
print_op
(
str
);
}
CHARSET_INFO
*
compare_collation
()
{
return
cmp_collation
.
collation
;
}
CHARSET_INFO
*
compare_collation
()
{
return
cmp_collation
.
collation
;
}
bool
check_partition_func_processor
(
byte
*
bool_arg
)
{
return
0
;
}
bool
check_partition_func_processor
(
byte
*
int_arg
)
{
return
FALSE
;
}
};
};
#else
#else
...
@@ -1183,7 +1183,7 @@ public:
...
@@ -1183,7 +1183,7 @@ public:
Item
*
transform
(
Item_transformer
transformer
,
byte
*
arg
);
Item
*
transform
(
Item_transformer
transformer
,
byte
*
arg
);
void
traverse_cond
(
Cond_traverser
,
void
*
arg
,
traverse_order
order
);
void
traverse_cond
(
Cond_traverser
,
void
*
arg
,
traverse_order
order
);
void
neg_arguments
(
THD
*
thd
);
void
neg_arguments
(
THD
*
thd
);
bool
check_partition_func_processor
(
byte
*
bool_arg
)
{
return
0
;
}
bool
check_partition_func_processor
(
byte
*
int_arg
)
{
return
FALSE
;
}
};
};
...
...
sql/item_func.h
View file @
674994b0
...
@@ -247,7 +247,7 @@ public:
...
@@ -247,7 +247,7 @@ public:
void
fix_num_length_and_dec
();
void
fix_num_length_and_dec
();
void
find_num_type
();
void
find_num_type
();
String
*
str_op
(
String
*
str
)
{
DBUG_ASSERT
(
0
);
return
0
;
}
String
*
str_op
(
String
*
str
)
{
DBUG_ASSERT
(
0
);
return
0
;
}
bool
check_partition_func_processor
(
byte
*
bool_arg
)
{
return
0
;
}
bool
check_partition_func_processor
(
byte
*
int_arg
)
{
return
FALSE
;
}
};
};
...
@@ -260,7 +260,7 @@ class Item_num_op :public Item_func_numhybrid
...
@@ -260,7 +260,7 @@ class Item_num_op :public Item_func_numhybrid
void
print
(
String
*
str
)
{
print_op
(
str
);
}
void
print
(
String
*
str
)
{
print_op
(
str
);
}
void
find_num_type
();
void
find_num_type
();
String
*
str_op
(
String
*
str
)
{
DBUG_ASSERT
(
0
);
return
0
;
}
String
*
str_op
(
String
*
str
)
{
DBUG_ASSERT
(
0
);
return
0
;
}
bool
check_partition_func_processor
(
byte
*
bool_arg
)
{
return
0
;
}
bool
check_partition_func_processor
(
byte
*
int_arg
)
{
return
FALSE
;
}
};
};
...
@@ -311,7 +311,7 @@ public:
...
@@ -311,7 +311,7 @@ public:
{
max_length
=
args
[
0
]
->
max_length
;
unsigned_flag
=
0
;
}
{
max_length
=
args
[
0
]
->
max_length
;
unsigned_flag
=
0
;
}
void
print
(
String
*
str
);
void
print
(
String
*
str
);
uint
decimal_precision
()
const
{
return
args
[
0
]
->
decimal_precision
();
}
uint
decimal_precision
()
const
{
return
args
[
0
]
->
decimal_precision
();
}
bool
check_partition_func_processor
(
byte
*
bool_arg
)
{
return
0
;
}
bool
check_partition_func_processor
(
byte
*
int_arg
)
{
return
FALSE
;
}
};
};
...
@@ -345,7 +345,7 @@ public:
...
@@ -345,7 +345,7 @@ public:
void
fix_length_and_dec
()
{};
void
fix_length_and_dec
()
{};
const
char
*
func_name
()
const
{
return
"decimal_typecast"
;
}
const
char
*
func_name
()
const
{
return
"decimal_typecast"
;
}
void
print
(
String
*
);
void
print
(
String
*
);
bool
check_partition_func_processor
(
byte
*
bool_arg
)
{
return
0
;
}
bool
check_partition_func_processor
(
byte
*
int_arg
)
{
return
FALSE
;
}
};
};
...
@@ -414,7 +414,7 @@ public:
...
@@ -414,7 +414,7 @@ public:
const
char
*
func_name
()
const
{
return
"DIV"
;
}
const
char
*
func_name
()
const
{
return
"DIV"
;
}
void
fix_length_and_dec
();
void
fix_length_and_dec
();
void
print
(
String
*
str
)
{
print_op
(
str
);
}
void
print
(
String
*
str
)
{
print_op
(
str
);
}
bool
check_partition_func_processor
(
byte
*
bool_arg
)
{
return
0
;
}
bool
check_partition_func_processor
(
byte
*
int_arg
)
{
return
FALSE
;
}
};
};
...
@@ -487,7 +487,7 @@ public:
...
@@ -487,7 +487,7 @@ public:
Item_func_exp
(
Item
*
a
)
:
Item_dec_func
(
a
)
{}
Item_func_exp
(
Item
*
a
)
:
Item_dec_func
(
a
)
{}
double
val_real
();
double
val_real
();
const
char
*
func_name
()
const
{
return
"exp"
;
}
const
char
*
func_name
()
const
{
return
"exp"
;
}
bool
check_partition_func_processor
(
byte
*
bool_arg
)
{
return
0
;
}
bool
check_partition_func_processor
(
byte
*
int_arg
)
{
return
FALSE
;
}
};
};
...
@@ -497,7 +497,7 @@ public:
...
@@ -497,7 +497,7 @@ public:
Item_func_ln
(
Item
*
a
)
:
Item_dec_func
(
a
)
{}
Item_func_ln
(
Item
*
a
)
:
Item_dec_func
(
a
)
{}
double
val_real
();
double
val_real
();
const
char
*
func_name
()
const
{
return
"ln"
;
}
const
char
*
func_name
()
const
{
return
"ln"
;
}
bool
check_partition_func_processor
(
byte
*
bool_arg
)
{
return
0
;
}
bool
check_partition_func_processor
(
byte
*
int_arg
)
{
return
FALSE
;
}
};
};
...
@@ -508,7 +508,7 @@ public:
...
@@ -508,7 +508,7 @@ public:
Item_func_log
(
Item
*
a
,
Item
*
b
)
:
Item_dec_func
(
a
,
b
)
{}
Item_func_log
(
Item
*
a
,
Item
*
b
)
:
Item_dec_func
(
a
,
b
)
{}
double
val_real
();
double
val_real
();
const
char
*
func_name
()
const
{
return
"log"
;
}
const
char
*
func_name
()
const
{
return
"log"
;
}
bool
check_partition_func_processor
(
byte
*
bool_arg
)
{
return
0
;
}
bool
check_partition_func_processor
(
byte
*
int_arg
)
{
return
FALSE
;
}
};
};
...
@@ -518,7 +518,7 @@ public:
...
@@ -518,7 +518,7 @@ public:
Item_func_log2
(
Item
*
a
)
:
Item_dec_func
(
a
)
{}
Item_func_log2
(
Item
*
a
)
:
Item_dec_func
(
a
)
{}
double
val_real
();
double
val_real
();
const
char
*
func_name
()
const
{
return
"log2"
;
}
const
char
*
func_name
()
const
{
return
"log2"
;
}
bool
check_partition_func_processor
(
byte
*
bool_arg
)
{
return
0
;
}
bool
check_partition_func_processor
(
byte
*
int_arg
)
{
return
FALSE
;
}
};
};
...
@@ -528,7 +528,7 @@ public:
...
@@ -528,7 +528,7 @@ public:
Item_func_log10
(
Item
*
a
)
:
Item_dec_func
(
a
)
{}
Item_func_log10
(
Item
*
a
)
:
Item_dec_func
(
a
)
{}
double
val_real
();
double
val_real
();
const
char
*
func_name
()
const
{
return
"log10"
;
}
const
char
*
func_name
()
const
{
return
"log10"
;
}
bool
check_partition_func_processor
(
byte
*
bool_arg
)
{
return
0
;
}
bool
check_partition_func_processor
(
byte
*
int_arg
)
{
return
FALSE
;
}
};
};
...
@@ -538,7 +538,7 @@ public:
...
@@ -538,7 +538,7 @@ public:
Item_func_sqrt
(
Item
*
a
)
:
Item_dec_func
(
a
)
{}
Item_func_sqrt
(
Item
*
a
)
:
Item_dec_func
(
a
)
{}
double
val_real
();
double
val_real
();
const
char
*
func_name
()
const
{
return
"sqrt"
;
}
const
char
*
func_name
()
const
{
return
"sqrt"
;
}
bool
check_partition_func_processor
(
byte
*
bool_arg
)
{
return
0
;
}
bool
check_partition_func_processor
(
byte
*
int_arg
)
{
return
FALSE
;
}
};
};
...
@@ -548,7 +548,7 @@ public:
...
@@ -548,7 +548,7 @@ public:
Item_func_pow
(
Item
*
a
,
Item
*
b
)
:
Item_dec_func
(
a
,
b
)
{}
Item_func_pow
(
Item
*
a
,
Item
*
b
)
:
Item_dec_func
(
a
,
b
)
{}
double
val_real
();
double
val_real
();
const
char
*
func_name
()
const
{
return
"pow"
;
}
const
char
*
func_name
()
const
{
return
"pow"
;
}
bool
check_partition_func_processor
(
byte
*
bool_arg
)
{
return
0
;
}
bool
check_partition_func_processor
(
byte
*
int_arg
)
{
return
FALSE
;
}
};
};
...
@@ -558,7 +558,7 @@ public:
...
@@ -558,7 +558,7 @@ public:
Item_func_acos
(
Item
*
a
)
:
Item_dec_func
(
a
)
{}
Item_func_acos
(
Item
*
a
)
:
Item_dec_func
(
a
)
{}
double
val_real
();
double
val_real
();
const
char
*
func_name
()
const
{
return
"acos"
;
}
const
char
*
func_name
()
const
{
return
"acos"
;
}
bool
check_partition_func_processor
(
byte
*
bool_arg
)
{
return
0
;
}
bool
check_partition_func_processor
(
byte
*
int_arg
)
{
return
FALSE
;
}
};
};
class
Item_func_asin
:
public
Item_dec_func
class
Item_func_asin
:
public
Item_dec_func
...
@@ -567,7 +567,7 @@ public:
...
@@ -567,7 +567,7 @@ public:
Item_func_asin
(
Item
*
a
)
:
Item_dec_func
(
a
)
{}
Item_func_asin
(
Item
*
a
)
:
Item_dec_func
(
a
)
{}
double
val_real
();
double
val_real
();
const
char
*
func_name
()
const
{
return
"asin"
;
}
const
char
*
func_name
()
const
{
return
"asin"
;
}
bool
check_partition_func_processor
(
byte
*
bool_arg
)
{
return
0
;
}
bool
check_partition_func_processor
(
byte
*
int_arg
)
{
return
FALSE
;
}
};
};
class
Item_func_atan
:
public
Item_dec_func
class
Item_func_atan
:
public
Item_dec_func
...
@@ -577,7 +577,7 @@ public:
...
@@ -577,7 +577,7 @@ public:
Item_func_atan
(
Item
*
a
,
Item
*
b
)
:
Item_dec_func
(
a
,
b
)
{}
Item_func_atan
(
Item
*
a
,
Item
*
b
)
:
Item_dec_func
(
a
,
b
)
{}
double
val_real
();
double
val_real
();
const
char
*
func_name
()
const
{
return
"atan"
;
}
const
char
*
func_name
()
const
{
return
"atan"
;
}
bool
check_partition_func_processor
(
byte
*
bool_arg
)
{
return
0
;
}
bool
check_partition_func_processor
(
byte
*
int_arg
)
{
return
FALSE
;
}
};
};
class
Item_func_cos
:
public
Item_dec_func
class
Item_func_cos
:
public
Item_dec_func
...
@@ -586,7 +586,7 @@ public:
...
@@ -586,7 +586,7 @@ public:
Item_func_cos
(
Item
*
a
)
:
Item_dec_func
(
a
)
{}
Item_func_cos
(
Item
*
a
)
:
Item_dec_func
(
a
)
{}
double
val_real
();
double
val_real
();
const
char
*
func_name
()
const
{
return
"cos"
;
}
const
char
*
func_name
()
const
{
return
"cos"
;
}
bool
check_partition_func_processor
(
byte
*
bool_arg
)
{
return
0
;
}
bool
check_partition_func_processor
(
byte
*
int_arg
)
{
return
FALSE
;
}
};
};
class
Item_func_sin
:
public
Item_dec_func
class
Item_func_sin
:
public
Item_dec_func
...
@@ -595,7 +595,7 @@ public:
...
@@ -595,7 +595,7 @@ public:
Item_func_sin
(
Item
*
a
)
:
Item_dec_func
(
a
)
{}
Item_func_sin
(
Item
*
a
)
:
Item_dec_func
(
a
)
{}
double
val_real
();
double
val_real
();
const
char
*
func_name
()
const
{
return
"sin"
;
}
const
char
*
func_name
()
const
{
return
"sin"
;
}
bool
check_partition_func_processor
(
byte
*
bool_arg
)
{
return
0
;
}
bool
check_partition_func_processor
(
byte
*
int_arg
)
{
return
FALSE
;
}
};
};
class
Item_func_tan
:
public
Item_dec_func
class
Item_func_tan
:
public
Item_dec_func
...
@@ -604,7 +604,7 @@ public:
...
@@ -604,7 +604,7 @@ public:
Item_func_tan
(
Item
*
a
)
:
Item_dec_func
(
a
)
{}
Item_func_tan
(
Item
*
a
)
:
Item_dec_func
(
a
)
{}
double
val_real
();
double
val_real
();
const
char
*
func_name
()
const
{
return
"tan"
;
}
const
char
*
func_name
()
const
{
return
"tan"
;
}
bool
check_partition_func_processor
(
byte
*
bool_arg
)
{
return
0
;
}
bool
check_partition_func_processor
(
byte
*
int_arg
)
{
return
FALSE
;
}
};
};
class
Item_func_integer
:
public
Item_int_func
class
Item_func_integer
:
public
Item_int_func
...
@@ -681,7 +681,7 @@ public:
...
@@ -681,7 +681,7 @@ public:
Item_func_sign
(
Item
*
a
)
:
Item_int_func
(
a
)
{}
Item_func_sign
(
Item
*
a
)
:
Item_int_func
(
a
)
{}
const
char
*
func_name
()
const
{
return
"sign"
;
}
const
char
*
func_name
()
const
{
return
"sign"
;
}
longlong
val_int
();
longlong
val_int
();
bool
check_partition_func_processor
(
byte
*
bool_arg
)
{
return
0
;
}
bool
check_partition_func_processor
(
byte
*
int_arg
)
{
return
FALSE
;
}
};
};
...
@@ -696,7 +696,7 @@ public:
...
@@ -696,7 +696,7 @@ public:
const
char
*
func_name
()
const
{
return
name
;
}
const
char
*
func_name
()
const
{
return
name
;
}
void
fix_length_and_dec
()
void
fix_length_and_dec
()
{
decimals
=
NOT_FIXED_DEC
;
max_length
=
float_length
(
decimals
);
}
{
decimals
=
NOT_FIXED_DEC
;
max_length
=
float_length
(
decimals
);
}
bool
check_partition_func_processor
(
byte
*
bool_arg
)
{
return
0
;
}
bool
check_partition_func_processor
(
byte
*
int_arg
)
{
return
FALSE
;
}
};
};
...
@@ -714,7 +714,7 @@ public:
...
@@ -714,7 +714,7 @@ public:
my_decimal
*
val_decimal
(
my_decimal
*
);
my_decimal
*
val_decimal
(
my_decimal
*
);
void
fix_length_and_dec
();
void
fix_length_and_dec
();
enum
Item_result
result_type
()
const
{
return
cmp_type
;
}
enum
Item_result
result_type
()
const
{
return
cmp_type
;
}
bool
check_partition_func_processor
(
byte
*
bool_arg
)
{
return
0
;
}
bool
check_partition_func_processor
(
byte
*
int_arg
)
{
return
FALSE
;
}
};
};
class
Item_func_min
:
public
Item_func_min_max
class
Item_func_min
:
public
Item_func_min_max
...
@@ -740,7 +740,7 @@ public:
...
@@ -740,7 +740,7 @@ public:
longlong
val_int
();
longlong
val_int
();
const
char
*
func_name
()
const
{
return
"length"
;
}
const
char
*
func_name
()
const
{
return
"length"
;
}
void
fix_length_and_dec
()
{
max_length
=
10
;
}
void
fix_length_and_dec
()
{
max_length
=
10
;
}
bool
check_partition_func_processor
(
byte
*
bool_arg
)
{
return
0
;
}
bool
check_partition_func_processor
(
byte
*
int_arg
)
{
return
FALSE
;
}
};
};
class
Item_func_bit_length
:
public
Item_func_length
class
Item_func_bit_length
:
public
Item_func_length
...
@@ -760,7 +760,7 @@ public:
...
@@ -760,7 +760,7 @@ public:
longlong
val_int
();
longlong
val_int
();
const
char
*
func_name
()
const
{
return
"char_length"
;
}
const
char
*
func_name
()
const
{
return
"char_length"
;
}
void
fix_length_and_dec
()
{
max_length
=
10
;
}
void
fix_length_and_dec
()
{
max_length
=
10
;
}
bool
check_partition_func_processor
(
byte
*
bool_arg
)
{
return
0
;
}
bool
check_partition_func_processor
(
byte
*
int_arg
)
{
return
FALSE
;
}
};
};
class
Item_func_coercibility
:
public
Item_int_func
class
Item_func_coercibility
:
public
Item_int_func
...
@@ -771,7 +771,6 @@ public:
...
@@ -771,7 +771,6 @@ public:
const
char
*
func_name
()
const
{
return
"coercibility"
;
}
const
char
*
func_name
()
const
{
return
"coercibility"
;
}
void
fix_length_and_dec
()
{
max_length
=
10
;
maybe_null
=
0
;
}
void
fix_length_and_dec
()
{
max_length
=
10
;
maybe_null
=
0
;
}
table_map
not_null_tables
()
const
{
return
0
;
}
table_map
not_null_tables
()
const
{
return
0
;
}
bool
check_partition_func_processor
(
byte
*
bool_arg
)
{
return
0
;}
};
};
class
Item_func_locate
:
public
Item_int_func
class
Item_func_locate
:
public
Item_int_func
...
@@ -785,7 +784,7 @@ public:
...
@@ -785,7 +784,7 @@ public:
longlong
val_int
();
longlong
val_int
();
void
fix_length_and_dec
();
void
fix_length_and_dec
();
void
print
(
String
*
str
);
void
print
(
String
*
str
);
bool
check_partition_func_processor
(
byte
*
bool_arg
)
{
return
0
;
}
bool
check_partition_func_processor
(
byte
*
int_arg
)
{
return
FALSE
;
}
};
};
...
@@ -810,7 +809,7 @@ public:
...
@@ -810,7 +809,7 @@ public:
longlong
val_int
();
longlong
val_int
();
const
char
*
func_name
()
const
{
return
"ascii"
;
}
const
char
*
func_name
()
const
{
return
"ascii"
;
}
void
fix_length_and_dec
()
{
max_length
=
3
;
}
void
fix_length_and_dec
()
{
max_length
=
3
;
}
bool
check_partition_func_processor
(
byte
*
bool_arg
)
{
return
0
;
}
bool
check_partition_func_processor
(
byte
*
int_arg
)
{
return
FALSE
;
}
};
};
class
Item_func_ord
:
public
Item_int_func
class
Item_func_ord
:
public
Item_int_func
...
@@ -820,7 +819,7 @@ public:
...
@@ -820,7 +819,7 @@ public:
Item_func_ord
(
Item
*
a
)
:
Item_int_func
(
a
)
{}
Item_func_ord
(
Item
*
a
)
:
Item_int_func
(
a
)
{}
longlong
val_int
();
longlong
val_int
();
const
char
*
func_name
()
const
{
return
"ord"
;
}
const
char
*
func_name
()
const
{
return
"ord"
;
}
bool
check_partition_func_processor
(
byte
*
bool_arg
)
{
return
0
;
}
bool
check_partition_func_processor
(
byte
*
int_arg
)
{
return
FALSE
;
}
};
};
class
Item_func_find_in_set
:
public
Item_int_func
class
Item_func_find_in_set
:
public
Item_int_func
...
@@ -834,7 +833,7 @@ public:
...
@@ -834,7 +833,7 @@ public:
longlong
val_int
();
longlong
val_int
();
const
char
*
func_name
()
const
{
return
"find_in_set"
;
}
const
char
*
func_name
()
const
{
return
"find_in_set"
;
}
void
fix_length_and_dec
();
void
fix_length_and_dec
();
bool
check_partition_func_processor
(
byte
*
bool_arg
)
{
return
0
;
}
bool
check_partition_func_processor
(
byte
*
int_arg
)
{
return
FALSE
;
}
};
};
/* Base class for all bit functions: '~', '|', '^', '&', '>>', '<<' */
/* Base class for all bit functions: '~', '|', '^', '&', '>>', '<<' */
...
@@ -846,7 +845,7 @@ public:
...
@@ -846,7 +845,7 @@ public:
Item_func_bit
(
Item
*
a
)
:
Item_int_func
(
a
)
{}
Item_func_bit
(
Item
*
a
)
:
Item_int_func
(
a
)
{}
void
fix_length_and_dec
()
{
unsigned_flag
=
1
;
}
void
fix_length_and_dec
()
{
unsigned_flag
=
1
;
}
void
print
(
String
*
str
)
{
print_op
(
str
);
}
void
print
(
String
*
str
)
{
print_op
(
str
);
}
bool
check_partition_func_processor
(
byte
*
bool_arg
)
{
return
0
;
}
bool
check_partition_func_processor
(
byte
*
int_arg
)
{
return
FALSE
;
}
};
};
class
Item_func_bit_or
:
public
Item_func_bit
class
Item_func_bit_or
:
public
Item_func_bit
...
@@ -872,7 +871,7 @@ public:
...
@@ -872,7 +871,7 @@ public:
longlong
val_int
();
longlong
val_int
();
const
char
*
func_name
()
const
{
return
"bit_count"
;
}
const
char
*
func_name
()
const
{
return
"bit_count"
;
}
void
fix_length_and_dec
()
{
max_length
=
2
;
}
void
fix_length_and_dec
()
{
max_length
=
2
;
}
bool
check_partition_func_processor
(
byte
*
bool_arg
)
{
return
0
;
}
bool
check_partition_func_processor
(
byte
*
int_arg
)
{
return
FALSE
;
}
};
};
class
Item_func_shift_left
:
public
Item_func_bit
class
Item_func_shift_left
:
public
Item_func_bit
...
@@ -1309,7 +1308,7 @@ public:
...
@@ -1309,7 +1308,7 @@ public:
longlong
val_int
();
longlong
val_int
();
const
char
*
func_name
()
const
{
return
"inet_aton"
;
}
const
char
*
func_name
()
const
{
return
"inet_aton"
;
}
void
fix_length_and_dec
()
{
decimals
=
0
;
max_length
=
21
;
maybe_null
=
1
;}
void
fix_length_and_dec
()
{
decimals
=
0
;
max_length
=
21
;
maybe_null
=
1
;}
bool
check_partition_func_processor
(
byte
*
bool_arg
)
{
return
0
;
}
bool
check_partition_func_processor
(
byte
*
int_arg
)
{
return
FALSE
;
}
};
};
...
...
sql/item_strfunc.h
View file @
674994b0
...
@@ -47,7 +47,7 @@ public:
...
@@ -47,7 +47,7 @@ public:
String
*
val_str
(
String
*
);
String
*
val_str
(
String
*
);
void
fix_length_and_dec
();
void
fix_length_and_dec
();
const
char
*
func_name
()
const
{
return
"md5"
;
}
const
char
*
func_name
()
const
{
return
"md5"
;
}
bool
check_partition_func_processor
(
byte
*
bool_arg
)
{
return
0
;
}
bool
check_partition_func_processor
(
byte
*
int_arg
)
{
return
FALSE
;
}
};
};
...
@@ -58,7 +58,6 @@ public:
...
@@ -58,7 +58,6 @@ public:
String
*
val_str
(
String
*
);
String
*
val_str
(
String
*
);
void
fix_length_and_dec
();
void
fix_length_and_dec
();
const
char
*
func_name
()
const
{
return
"sha"
;
}
const
char
*
func_name
()
const
{
return
"sha"
;
}
bool
check_partition_func_processor
(
byte
*
bool_arg
)
{
return
0
;}
};
};
class
Item_func_aes_encrypt
:
public
Item_str_func
class
Item_func_aes_encrypt
:
public
Item_str_func
...
@@ -89,7 +88,7 @@ public:
...
@@ -89,7 +88,7 @@ public:
String
*
val_str
(
String
*
);
String
*
val_str
(
String
*
);
void
fix_length_and_dec
();
void
fix_length_and_dec
();
const
char
*
func_name
()
const
{
return
"concat"
;
}
const
char
*
func_name
()
const
{
return
"concat"
;
}
bool
check_partition_func_processor
(
byte
*
bool_arg
)
{
return
0
;
}
bool
check_partition_func_processor
(
byte
*
int_arg
)
{
return
FALSE
;
}
};
};
class
Item_func_concat_ws
:
public
Item_str_func
class
Item_func_concat_ws
:
public
Item_str_func
...
@@ -110,7 +109,7 @@ public:
...
@@ -110,7 +109,7 @@ public:
String
*
val_str
(
String
*
);
String
*
val_str
(
String
*
);
void
fix_length_and_dec
();
void
fix_length_and_dec
();
const
char
*
func_name
()
const
{
return
"reverse"
;
}
const
char
*
func_name
()
const
{
return
"reverse"
;
}
bool
check_partition_func_processor
(
byte
*
bool_arg
)
{
return
0
;
}
bool
check_partition_func_processor
(
byte
*
int_arg
)
{
return
FALSE
;
}
};
};
...
@@ -148,7 +147,7 @@ protected:
...
@@ -148,7 +147,7 @@ protected:
public:
public:
Item_str_conv
(
Item
*
item
)
:
Item_str_func
(
item
)
{}
Item_str_conv
(
Item
*
item
)
:
Item_str_func
(
item
)
{}
String
*
val_str
(
String
*
);
String
*
val_str
(
String
*
);
bool
check_partition_func_processor
(
byte
*
bool_arg
)
{
return
0
;
}
bool
check_partition_func_processor
(
byte
*
int_arg
)
{
return
FALSE
;
}
};
};
...
@@ -212,7 +211,6 @@ public:
...
@@ -212,7 +211,6 @@ public:
String
*
val_str
(
String
*
);
String
*
val_str
(
String
*
);
void
fix_length_and_dec
();
void
fix_length_and_dec
();
const
char
*
func_name
()
const
{
return
"substr"
;
}
const
char
*
func_name
()
const
{
return
"substr"
;
}
bool
check_partition_func_processor
(
byte
*
bool_arg
)
{
return
0
;}
};
};
...
@@ -224,7 +222,6 @@ public:
...
@@ -224,7 +222,6 @@ public:
String
*
val_str
(
String
*
);
String
*
val_str
(
String
*
);
void
fix_length_and_dec
();
void
fix_length_and_dec
();
const
char
*
func_name
()
const
{
return
"substring_index"
;
}
const
char
*
func_name
()
const
{
return
"substring_index"
;
}
bool
check_partition_func_processor
(
byte
*
bool_arg
)
{
return
0
;}
};
};
...
@@ -239,7 +236,6 @@ public:
...
@@ -239,7 +236,6 @@ public:
String
*
val_str
(
String
*
);
String
*
val_str
(
String
*
);
void
fix_length_and_dec
();
void
fix_length_and_dec
();
const
char
*
func_name
()
const
{
return
"trim"
;
}
const
char
*
func_name
()
const
{
return
"trim"
;
}
bool
check_partition_func_processor
(
byte
*
bool_arg
)
{
return
0
;}
};
};
...
@@ -419,7 +415,7 @@ public:
...
@@ -419,7 +415,7 @@ public:
String
*
val_str
(
String
*
);
String
*
val_str
(
String
*
);
void
fix_length_and_dec
();
void
fix_length_and_dec
();
const
char
*
func_name
()
const
{
return
"soundex"
;
}
const
char
*
func_name
()
const
{
return
"soundex"
;
}
bool
check_partition_func_processor
(
byte
*
bool_arg
)
{
return
0
;
}
bool
check_partition_func_processor
(
byte
*
int_arg
)
{
return
FALSE
;
}
};
};
...
@@ -527,7 +523,7 @@ public:
...
@@ -527,7 +523,7 @@ public:
String
*
val_str
(
String
*
);
String
*
val_str
(
String
*
);
void
fix_length_and_dec
();
void
fix_length_and_dec
();
const
char
*
func_name
()
const
{
return
"rpad"
;
}
const
char
*
func_name
()
const
{
return
"rpad"
;
}
bool
check_partition_func_processor
(
byte
*
bool_arg
)
{
return
0
;
}
bool
check_partition_func_processor
(
byte
*
int_arg
)
{
return
FALSE
;
}
};
};
...
@@ -540,7 +536,7 @@ public:
...
@@ -540,7 +536,7 @@ public:
String
*
val_str
(
String
*
);
String
*
val_str
(
String
*
);
void
fix_length_and_dec
();
void
fix_length_and_dec
();
const
char
*
func_name
()
const
{
return
"lpad"
;
}
const
char
*
func_name
()
const
{
return
"lpad"
;
}
bool
check_partition_func_processor
(
byte
*
bool_arg
)
{
return
0
;
}
bool
check_partition_func_processor
(
byte
*
int_arg
)
{
return
FALSE
;
}
};
};
...
@@ -555,7 +551,7 @@ public:
...
@@ -555,7 +551,7 @@ public:
collation
.
set
(
default_charset
());
collation
.
set
(
default_charset
());
max_length
=
64
;
max_length
=
64
;
}
}
bool
check_partition_func_processor
(
byte
*
bool_arg
)
{
return
0
;
}
bool
check_partition_func_processor
(
byte
*
int_arg
)
{
return
FALSE
;
}
};
};
...
@@ -572,7 +568,7 @@ public:
...
@@ -572,7 +568,7 @@ public:
decimals
=
0
;
decimals
=
0
;
max_length
=
args
[
0
]
->
max_length
*
2
*
collation
.
collation
->
mbmaxlen
;
max_length
=
args
[
0
]
->
max_length
*
2
*
collation
.
collation
->
mbmaxlen
;
}
}
bool
check_partition_func_processor
(
byte
*
bool_arg
)
{
return
0
;
}
bool
check_partition_func_processor
(
byte
*
int_arg
)
{
return
FALSE
;
}
};
};
class
Item_func_unhex
:
public
Item_str_func
class
Item_func_unhex
:
public
Item_str_func
...
@@ -588,7 +584,7 @@ public:
...
@@ -588,7 +584,7 @@ public:
decimals
=
0
;
decimals
=
0
;
max_length
=
(
1
+
args
[
0
]
->
max_length
)
/
2
;
max_length
=
(
1
+
args
[
0
]
->
max_length
)
/
2
;
}
}
bool
check_partition_func_processor
(
byte
*
bool_arg
)
{
return
0
;
}
bool
check_partition_func_processor
(
byte
*
int_arg
)
{
return
FALSE
;
}
};
};
...
@@ -612,7 +608,7 @@ public:
...
@@ -612,7 +608,7 @@ public:
}
}
void
print
(
String
*
str
);
void
print
(
String
*
str
);
const
char
*
func_name
()
const
{
return
"cast_as_binary"
;
}
const
char
*
func_name
()
const
{
return
"cast_as_binary"
;
}
bool
check_partition_func_processor
(
byte
*
bool_arg
)
{
return
0
;
}
bool
check_partition_func_processor
(
byte
*
int_arg
)
{
return
FALSE
;
}
};
};
...
@@ -652,7 +648,7 @@ public:
...
@@ -652,7 +648,7 @@ public:
String
*
val_str
(
String
*
str
);
String
*
val_str
(
String
*
str
);
const
char
*
func_name
()
const
{
return
"inet_ntoa"
;
}
const
char
*
func_name
()
const
{
return
"inet_ntoa"
;
}
void
fix_length_and_dec
()
{
decimals
=
0
;
max_length
=
3
*
8
+
7
;
}
void
fix_length_and_dec
()
{
decimals
=
0
;
max_length
=
3
*
8
+
7
;
}
bool
check_partition_func_processor
(
byte
*
bool_arg
)
{
return
0
;
}
bool
check_partition_func_processor
(
byte
*
int_arg
)
{
return
FALSE
;
}
};
};
class
Item_func_quote
:
public
Item_str_func
class
Item_func_quote
:
public
Item_str_func
...
@@ -667,7 +663,7 @@ public:
...
@@ -667,7 +663,7 @@ public:
collation
.
set
(
args
[
0
]
->
collation
);
collation
.
set
(
args
[
0
]
->
collation
);
max_length
=
args
[
0
]
->
max_length
*
2
+
2
;
max_length
=
args
[
0
]
->
max_length
*
2
+
2
;
}
}
bool
check_partition_func_processor
(
byte
*
bool_arg
)
{
return
0
;
}
bool
check_partition_func_processor
(
byte
*
int_arg
)
{
return
FALSE
;
}
};
};
class
Item_func_conv_charset
:
public
Item_str_func
class
Item_func_conv_charset
:
public
Item_str_func
...
@@ -711,7 +707,6 @@ public:
...
@@ -711,7 +707,6 @@ public:
void
fix_length_and_dec
();
void
fix_length_and_dec
();
const
char
*
func_name
()
const
{
return
"convert"
;
}
const
char
*
func_name
()
const
{
return
"convert"
;
}
void
print
(
String
*
str
);
void
print
(
String
*
str
);
bool
check_partition_func_processor
(
byte
*
bool_arg
)
{
return
0
;}
};
};
class
Item_func_set_collation
:
public
Item_str_func
class
Item_func_set_collation
:
public
Item_str_func
...
@@ -744,7 +739,6 @@ public:
...
@@ -744,7 +739,6 @@ public:
maybe_null
=
0
;
maybe_null
=
0
;
};
};
table_map
not_null_tables
()
const
{
return
0
;
}
table_map
not_null_tables
()
const
{
return
0
;
}
bool
check_partition_func_processor
(
byte
*
bool_arg
)
{
return
0
;}
};
};
class
Item_func_collation
:
public
Item_str_func
class
Item_func_collation
:
public
Item_str_func
...
@@ -760,7 +754,6 @@ public:
...
@@ -760,7 +754,6 @@ public:
maybe_null
=
0
;
maybe_null
=
0
;
};
};
table_map
not_null_tables
()
const
{
return
0
;
}
table_map
not_null_tables
()
const
{
return
0
;
}
bool
check_partition_func_processor
(
byte
*
bool_arg
)
{
return
0
;}
};
};
class
Item_func_crc32
:
public
Item_int_func
class
Item_func_crc32
:
public
Item_int_func
...
@@ -771,7 +764,7 @@ public:
...
@@ -771,7 +764,7 @@ public:
const
char
*
func_name
()
const
{
return
"crc32"
;
}
const
char
*
func_name
()
const
{
return
"crc32"
;
}
void
fix_length_and_dec
()
{
max_length
=
10
;
}
void
fix_length_and_dec
()
{
max_length
=
10
;
}
longlong
val_int
();
longlong
val_int
();
bool
check_partition_func_processor
(
byte
*
bool_arg
)
{
return
0
;
}
bool
check_partition_func_processor
(
byte
*
int_arg
)
{
return
FALSE
;
}
};
};
class
Item_func_uncompressed_length
:
public
Item_int_func
class
Item_func_uncompressed_length
:
public
Item_int_func
...
@@ -782,7 +775,6 @@ public:
...
@@ -782,7 +775,6 @@ public:
const
char
*
func_name
()
const
{
return
"uncompressed_length"
;}
const
char
*
func_name
()
const
{
return
"uncompressed_length"
;}
void
fix_length_and_dec
()
{
max_length
=
10
;
}
void
fix_length_and_dec
()
{
max_length
=
10
;
}
longlong
val_int
();
longlong
val_int
();
bool
check_partition_func_processor
(
byte
*
bool_arg
)
{
return
0
;}
};
};
#ifdef HAVE_COMPRESS
#ifdef HAVE_COMPRESS
...
@@ -799,7 +791,6 @@ public:
...
@@ -799,7 +791,6 @@ public:
void
fix_length_and_dec
(){
max_length
=
(
args
[
0
]
->
max_length
*
120
)
/
100
+
12
;}
void
fix_length_and_dec
(){
max_length
=
(
args
[
0
]
->
max_length
*
120
)
/
100
+
12
;}
const
char
*
func_name
()
const
{
return
"compress"
;}
const
char
*
func_name
()
const
{
return
"compress"
;}
String
*
val_str
(
String
*
)
ZLIB_DEPENDED_FUNCTION
String
*
val_str
(
String
*
)
ZLIB_DEPENDED_FUNCTION
bool
check_partition_func_processor
(
byte
*
bool_arg
)
{
return
0
;}
};
};
class
Item_func_uncompress
:
public
Item_str_func
class
Item_func_uncompress
:
public
Item_str_func
...
@@ -810,7 +801,6 @@ public:
...
@@ -810,7 +801,6 @@ public:
void
fix_length_and_dec
(){
max_length
=
MAX_BLOB_WIDTH
;}
void
fix_length_and_dec
(){
max_length
=
MAX_BLOB_WIDTH
;}
const
char
*
func_name
()
const
{
return
"uncompress"
;}
const
char
*
func_name
()
const
{
return
"uncompress"
;}
String
*
val_str
(
String
*
)
ZLIB_DEPENDED_FUNCTION
String
*
val_str
(
String
*
)
ZLIB_DEPENDED_FUNCTION
bool
check_partition_func_processor
(
byte
*
bool_arg
)
{
return
0
;}
};
};
#define UUID_LENGTH (8+1+4+1+4+1+4+1+12)
#define UUID_LENGTH (8+1+4+1+4+1+4+1+12)
...
...
sql/item_timefunc.h
View file @
674994b0
...
@@ -39,7 +39,7 @@ public:
...
@@ -39,7 +39,7 @@ public:
{
{
max_length
=
6
*
MY_CHARSET_BIN_MB_MAXLEN
;
max_length
=
6
*
MY_CHARSET_BIN_MB_MAXLEN
;
}
}
bool
check_partition_func_processor
(
byte
*
bool_arg
)
{
return
0
;}
bool
check_partition_func_processor
(
byte
*
int_arg
)
{
return
FALSE
;}
};
};
...
@@ -54,7 +54,7 @@ public:
...
@@ -54,7 +54,7 @@ public:
decimals
=
0
;
decimals
=
0
;
max_length
=
6
*
MY_CHARSET_BIN_MB_MAXLEN
;
max_length
=
6
*
MY_CHARSET_BIN_MB_MAXLEN
;
}
}
bool
check_partition_func_processor
(
byte
*
bool_arg
)
{
return
0
;}
bool
check_partition_func_processor
(
byte
*
int_arg
)
{
return
FALSE
;}
};
};
...
@@ -71,7 +71,7 @@ public:
...
@@ -71,7 +71,7 @@ public:
maybe_null
=
1
;
maybe_null
=
1
;
}
}
enum_monotonicity_info
get_monotonicity_info
()
const
;
enum_monotonicity_info
get_monotonicity_info
()
const
;
bool
check_partition_func_processor
(
byte
*
bool_arg
)
{
return
0
;}
bool
check_partition_func_processor
(
byte
*
int_arg
)
{
return
FALSE
;}
};
};
...
@@ -87,7 +87,7 @@ public:
...
@@ -87,7 +87,7 @@ public:
max_length
=
2
*
MY_CHARSET_BIN_MB_MAXLEN
;
max_length
=
2
*
MY_CHARSET_BIN_MB_MAXLEN
;
maybe_null
=
1
;
maybe_null
=
1
;
}
}
bool
check_partition_func_processor
(
byte
*
bool_arg
)
{
return
0
;}
bool
check_partition_func_processor
(
byte
*
int_arg
)
{
return
FALSE
;}
};
};
...
@@ -112,7 +112,7 @@ public:
...
@@ -112,7 +112,7 @@ public:
max_length
=
2
*
MY_CHARSET_BIN_MB_MAXLEN
;
max_length
=
2
*
MY_CHARSET_BIN_MB_MAXLEN
;
maybe_null
=
1
;
maybe_null
=
1
;
}
}
bool
check_partition_func_processor
(
byte
*
bool_arg
)
{
return
0
;}
bool
check_partition_func_processor
(
byte
*
int_arg
)
{
return
FALSE
;}
};
};
...
@@ -145,7 +145,7 @@ public:
...
@@ -145,7 +145,7 @@ public:
max_length
=
3
*
MY_CHARSET_BIN_MB_MAXLEN
;
max_length
=
3
*
MY_CHARSET_BIN_MB_MAXLEN
;
maybe_null
=
1
;
maybe_null
=
1
;
}
}
bool
check_partition_func_processor
(
byte
*
bool_arg
)
{
return
0
;}
bool
check_partition_func_processor
(
byte
*
int_arg
)
{
return
FALSE
;}
};
};
...
@@ -161,7 +161,7 @@ public:
...
@@ -161,7 +161,7 @@ public:
max_length
=
2
*
MY_CHARSET_BIN_MB_MAXLEN
;
max_length
=
2
*
MY_CHARSET_BIN_MB_MAXLEN
;
maybe_null
=
1
;
maybe_null
=
1
;
}
}
bool
check_partition_func_processor
(
byte
*
bool_arg
)
{
return
0
;}
bool
check_partition_func_processor
(
byte
*
int_arg
)
{
return
FALSE
;}
};
};
...
@@ -177,7 +177,7 @@ public:
...
@@ -177,7 +177,7 @@ public:
max_length
=
2
*
MY_CHARSET_BIN_MB_MAXLEN
;
max_length
=
2
*
MY_CHARSET_BIN_MB_MAXLEN
;
maybe_null
=
1
;
maybe_null
=
1
;
}
}
bool
check_partition_func_processor
(
byte
*
bool_arg
)
{
return
0
;}
bool
check_partition_func_processor
(
byte
*
int_arg
)
{
return
FALSE
;}
};
};
...
@@ -193,7 +193,7 @@ public:
...
@@ -193,7 +193,7 @@ public:
max_length
=
1
*
MY_CHARSET_BIN_MB_MAXLEN
;
max_length
=
1
*
MY_CHARSET_BIN_MB_MAXLEN
;
maybe_null
=
1
;
maybe_null
=
1
;
}
}
bool
check_partition_func_processor
(
byte
*
bool_arg
)
{
return
0
;}
bool
check_partition_func_processor
(
byte
*
int_arg
)
{
return
FALSE
;}
};
};
...
@@ -209,7 +209,7 @@ public:
...
@@ -209,7 +209,7 @@ public:
max_length
=
2
*
MY_CHARSET_BIN_MB_MAXLEN
;
max_length
=
2
*
MY_CHARSET_BIN_MB_MAXLEN
;
maybe_null
=
1
;
maybe_null
=
1
;
}
}
bool
check_partition_func_processor
(
byte
*
bool_arg
)
{
return
0
;}
bool
check_partition_func_processor
(
byte
*
int_arg
)
{
return
FALSE
;}
};
};
...
@@ -225,7 +225,7 @@ public:
...
@@ -225,7 +225,7 @@ public:
max_length
=
2
*
MY_CHARSET_BIN_MB_MAXLEN
;
max_length
=
2
*
MY_CHARSET_BIN_MB_MAXLEN
;
maybe_null
=
1
;
maybe_null
=
1
;
}
}
bool
check_partition_func_processor
(
byte
*
bool_arg
)
{
return
0
;}
bool
check_partition_func_processor
(
byte
*
int_arg
)
{
return
FALSE
;}
};
};
class
Item_func_yearweek
:
public
Item_int_func
class
Item_func_yearweek
:
public
Item_int_func
...
@@ -240,7 +240,7 @@ public:
...
@@ -240,7 +240,7 @@ public:
max_length
=
6
*
MY_CHARSET_BIN_MB_MAXLEN
;
max_length
=
6
*
MY_CHARSET_BIN_MB_MAXLEN
;
maybe_null
=
1
;
maybe_null
=
1
;
}
}
bool
check_partition_func_processor
(
byte
*
bool_arg
)
{
return
0
;}
bool
check_partition_func_processor
(
byte
*
int_arg
)
{
return
FALSE
;}
};
};
...
@@ -257,7 +257,7 @@ public:
...
@@ -257,7 +257,7 @@ public:
max_length
=
4
*
MY_CHARSET_BIN_MB_MAXLEN
;
max_length
=
4
*
MY_CHARSET_BIN_MB_MAXLEN
;
maybe_null
=
1
;
maybe_null
=
1
;
}
}
bool
check_partition_func_processor
(
byte
*
bool_arg
)
{
return
0
;}
bool
check_partition_func_processor
(
byte
*
int_arg
)
{
return
FALSE
;}
};
};
...
@@ -287,7 +287,7 @@ public:
...
@@ -287,7 +287,7 @@ public:
max_length
=
1
*
MY_CHARSET_BIN_MB_MAXLEN
;
max_length
=
1
*
MY_CHARSET_BIN_MB_MAXLEN
;
maybe_null
=
1
;
maybe_null
=
1
;
}
}
bool
check_partition_func_processor
(
byte
*
bool_arg
)
{
return
0
;}
bool
check_partition_func_processor
(
byte
*
int_arg
)
{
return
FALSE
;}
};
};
class
Item_func_dayname
:
public
Item_func_weekday
class
Item_func_dayname
:
public
Item_func_weekday
...
@@ -320,7 +320,7 @@ public:
...
@@ -320,7 +320,7 @@ public:
decimals
=
0
;
decimals
=
0
;
max_length
=
10
*
MY_CHARSET_BIN_MB_MAXLEN
;
max_length
=
10
*
MY_CHARSET_BIN_MB_MAXLEN
;
}
}
bool
check_partition_func_processor
(
byte
*
bool_arg
)
{
return
0
;}
bool
check_partition_func_processor
(
byte
*
int_arg
)
{
return
FALSE
;}
};
};
...
@@ -335,7 +335,7 @@ public:
...
@@ -335,7 +335,7 @@ public:
decimals
=
0
;
decimals
=
0
;
max_length
=
10
*
MY_CHARSET_BIN_MB_MAXLEN
;
max_length
=
10
*
MY_CHARSET_BIN_MB_MAXLEN
;
}
}
bool
check_partition_func_processor
(
byte
*
bool_arg
)
{
return
0
;}
bool
check_partition_func_processor
(
byte
*
int_arg
)
{
return
FALSE
;}
};
};
...
@@ -545,7 +545,7 @@ public:
...
@@ -545,7 +545,7 @@ public:
Item_func_from_days
(
Item
*
a
)
:
Item_date
(
a
)
{}
Item_func_from_days
(
Item
*
a
)
:
Item_date
(
a
)
{}
const
char
*
func_name
()
const
{
return
"from_days"
;
}
const
char
*
func_name
()
const
{
return
"from_days"
;
}
bool
get_date
(
TIME
*
res
,
uint
fuzzy_date
);
bool
get_date
(
TIME
*
res
,
uint
fuzzy_date
);
bool
check_partition_func_processor
(
byte
*
bool_arg
)
{
return
0
;}
bool
check_partition_func_processor
(
byte
*
int_arg
)
{
return
FALSE
;}
};
};
...
@@ -563,7 +563,7 @@ public:
...
@@ -563,7 +563,7 @@ public:
void
fix_length_and_dec
();
void
fix_length_and_dec
();
uint
format_length
(
const
String
*
format
);
uint
format_length
(
const
String
*
format
);
bool
eq
(
const
Item
*
item
,
bool
binary_cmp
)
const
;
bool
eq
(
const
Item
*
item
,
bool
binary_cmp
)
const
;
bool
check_partition_func_processor
(
byte
*
bool_arg
)
{
return
0
;}
bool
check_partition_func_processor
(
byte
*
int_arg
)
{
return
FALSE
;}
};
};
...
@@ -582,7 +582,7 @@ class Item_func_from_unixtime :public Item_date_func
...
@@ -582,7 +582,7 @@ class Item_func_from_unixtime :public Item_date_func
const
char
*
func_name
()
const
{
return
"from_unixtime"
;
}
const
char
*
func_name
()
const
{
return
"from_unixtime"
;
}
void
fix_length_and_dec
();
void
fix_length_and_dec
();
bool
get_date
(
TIME
*
res
,
uint
fuzzy_date
);
bool
get_date
(
TIME
*
res
,
uint
fuzzy_date
);
bool
check_partition_func_processor
(
byte
*
bool_arg
)
{
return
0
;}
bool
check_partition_func_processor
(
byte
*
int_arg
)
{
return
FALSE
;}
};
};
...
@@ -651,7 +651,7 @@ public:
...
@@ -651,7 +651,7 @@ public:
return
tmp_table_field_from_field_type
(
table
,
0
);
return
tmp_table_field_from_field_type
(
table
,
0
);
}
}
bool
result_as_longlong
()
{
return
TRUE
;
}
bool
result_as_longlong
()
{
return
TRUE
;
}
bool
check_partition_func_processor
(
byte
*
bool_arg
)
{
return
0
;}
bool
check_partition_func_processor
(
byte
*
int_arg
)
{
return
FALSE
;}
};
};
...
@@ -674,7 +674,7 @@ public:
...
@@ -674,7 +674,7 @@ public:
bool
get_date
(
TIME
*
res
,
uint
fuzzy_date
);
bool
get_date
(
TIME
*
res
,
uint
fuzzy_date
);
bool
eq
(
const
Item
*
item
,
bool
binary_cmp
)
const
;
bool
eq
(
const
Item
*
item
,
bool
binary_cmp
)
const
;
void
print
(
String
*
str
);
void
print
(
String
*
str
);
bool
check_partition_func_processor
(
byte
*
bool_arg
)
{
return
0
;}
bool
check_partition_func_processor
(
byte
*
int_arg
)
{
return
FALSE
;}
};
};
...
@@ -692,7 +692,7 @@ class Item_extract :public Item_int_func
...
@@ -692,7 +692,7 @@ class Item_extract :public Item_int_func
void
fix_length_and_dec
();
void
fix_length_and_dec
();
bool
eq
(
const
Item
*
item
,
bool
binary_cmp
)
const
;
bool
eq
(
const
Item
*
item
,
bool
binary_cmp
)
const
;
void
print
(
String
*
str
);
void
print
(
String
*
str
);
bool
check_partition_func_processor
(
byte
*
bool_arg
)
{
return
0
;}
bool
check_partition_func_processor
(
byte
*
int_arg
)
{
return
FALSE
;}
};
};
...
@@ -729,7 +729,7 @@ public:
...
@@ -729,7 +729,7 @@ public:
max_length
=
args
[
0
]
->
max_length
;
max_length
=
args
[
0
]
->
max_length
;
maybe_null
=
1
;
maybe_null
=
1
;
}
}
bool
check_partition_func_processor
(
byte
*
bool_arg
)
{
return
0
;}
bool
check_partition_func_processor
(
byte
*
int_arg
)
{
return
FALSE
;}
};
};
...
@@ -749,7 +749,7 @@ public:
...
@@ -749,7 +749,7 @@ public:
String
*
val_str
(
String
*
a
);
String
*
val_str
(
String
*
a
);
void
fix_length_and_dec
();
void
fix_length_and_dec
();
void
print
(
String
*
str
);
void
print
(
String
*
str
);
bool
check_partition_func_processor
(
byte
*
bool_arg
)
{
return
0
;}
bool
check_partition_func_processor
(
byte
*
int_arg
)
{
return
FALSE
;}
};
};
...
@@ -829,7 +829,7 @@ public:
...
@@ -829,7 +829,7 @@ public:
}
}
bool
result_as_longlong
()
{
return
TRUE
;
}
bool
result_as_longlong
()
{
return
TRUE
;
}
longlong
val_int
();
longlong
val_int
();
bool
check_partition_func_processor
(
byte
*
bool_arg
)
{
return
0
;}
bool
check_partition_func_processor
(
byte
*
int_arg
)
{
return
FALSE
;}
};
};
...
@@ -852,7 +852,7 @@ public:
...
@@ -852,7 +852,7 @@ public:
}
}
void
print
(
String
*
str
);
void
print
(
String
*
str
);
const
char
*
func_name
()
const
{
return
"add_time"
;
}
const
char
*
func_name
()
const
{
return
"add_time"
;
}
bool
check_partition_func_processor
(
byte
*
bool_arg
)
{
return
0
;}
bool
check_partition_func_processor
(
byte
*
int_arg
)
{
return
FALSE
;}
};
};
class
Item_func_timediff
:
public
Item_str_func
class
Item_func_timediff
:
public
Item_str_func
...
@@ -892,7 +892,7 @@ public:
...
@@ -892,7 +892,7 @@ public:
{
{
return
tmp_table_field_from_field_type
(
table
,
0
);
return
tmp_table_field_from_field_type
(
table
,
0
);
}
}
bool
check_partition_func_processor
(
byte
*
bool_arg
)
{
return
0
;}
bool
check_partition_func_processor
(
byte
*
int_arg
)
{
return
FALSE
;}
};
};
class
Item_func_microsecond
:
public
Item_int_func
class
Item_func_microsecond
:
public
Item_int_func
...
@@ -906,7 +906,7 @@ public:
...
@@ -906,7 +906,7 @@ public:
decimals
=
0
;
decimals
=
0
;
maybe_null
=
1
;
maybe_null
=
1
;
}
}
bool
check_partition_func_processor
(
byte
*
bool_arg
)
{
return
0
;}
bool
check_partition_func_processor
(
byte
*
int_arg
)
{
return
FALSE
;}
};
};
...
@@ -924,7 +924,7 @@ public:
...
@@ -924,7 +924,7 @@ public:
maybe_null
=
1
;
maybe_null
=
1
;
}
}
void
print
(
String
*
str
);
void
print
(
String
*
str
);
bool
check_partition_func_processor
(
byte
*
bool_arg
)
{
return
0
;}
bool
check_partition_func_processor
(
byte
*
int_arg
)
{
return
FALSE
;}
};
};
...
@@ -971,7 +971,7 @@ public:
...
@@ -971,7 +971,7 @@ public:
{
{
return
tmp_table_field_from_field_type
(
table
,
1
);
return
tmp_table_field_from_field_type
(
table
,
1
);
}
}
bool
check_partition_func_processor
(
byte
*
bool_arg
)
{
return
0
;}
bool
check_partition_func_processor
(
byte
*
int_arg
)
{
return
FALSE
;}
};
};
...
...
sql/item_xmlfunc.h
View file @
674994b0
...
@@ -42,7 +42,7 @@ public:
...
@@ -42,7 +42,7 @@ public:
Item_func_xml_extractvalue
(
Item
*
a
,
Item
*
b
)
:
Item_xml_str_func
(
a
,
b
)
{}
Item_func_xml_extractvalue
(
Item
*
a
,
Item
*
b
)
:
Item_xml_str_func
(
a
,
b
)
{}
const
char
*
func_name
()
const
{
return
"extractvalue"
;
}
const
char
*
func_name
()
const
{
return
"extractvalue"
;
}
String
*
val_str
(
String
*
);
String
*
val_str
(
String
*
);
bool
check_partition_func_processor
(
byte
*
bool_arg
)
{
return
0
;
}
bool
check_partition_func_processor
(
byte
*
int_arg
)
{
return
FALSE
;
}
};
};
...
...
sql/partition_info.cc
View file @
674994b0
...
@@ -695,6 +695,7 @@ end:
...
@@ -695,6 +695,7 @@ end:
file A reference to a handler of the table
file A reference to a handler of the table
info Create info
info Create info
engine_type Return value for used engine in partitions
engine_type Return value for used engine in partitions
check_partition_function Should we check the partition function
RETURN VALUE
RETURN VALUE
TRUE Error, something went wrong
TRUE Error, something went wrong
...
@@ -709,26 +710,41 @@ end:
...
@@ -709,26 +710,41 @@ end:
*/
*/
bool
partition_info
::
check_partition_info
(
THD
*
thd
,
handlerton
**
eng_type
,
bool
partition_info
::
check_partition_info
(
THD
*
thd
,
handlerton
**
eng_type
,
handler
*
file
,
HA_CREATE_INFO
*
info
)
handler
*
file
,
HA_CREATE_INFO
*
info
,
bool
check_partition_function
)
{
{
handlerton
**
engine_array
=
NULL
;
handlerton
**
engine_array
=
NULL
;
uint
part_count
=
0
;
uint
part_count
=
0
;
uint
i
,
tot_partitions
;
uint
i
,
tot_partitions
;
bool
result
=
TRUE
;
bool
result
=
TRUE
;
char
*
same_name
;
char
*
same_name
;
bool
part_expression_ok
=
TRUE
;
DBUG_ENTER
(
"partition_info::check_partition_info"
);
DBUG_ENTER
(
"partition_info::check_partition_info"
);
if
(
part_type
!=
HASH_PARTITION
||
!
list_of_part_fields
)
if
(
check_partition_function
)
part_expr
->
walk
(
&
Item
::
check_partition_func_processor
,
0
,
(
byte
*
)(
&
part_expression_ok
));
if
(
is_sub_partitioned
()
&&
!
list_of_subpart_fields
)
subpart_expr
->
walk
(
&
Item
::
check_partition_func_processor
,
0
,
(
byte
*
)(
&
part_expression_ok
));
if
(
!
part_expression_ok
)
{
{
my_error
(
ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
,
MYF
(
0
));
int
part_expression_ok
=
1
;
goto
end
;
int
pf_collation_allowed
=
1
;
int
spf_collation_allowed
=
1
;
if
(
part_type
!=
HASH_PARTITION
||
!
list_of_part_fields
)
{
part_expr
->
walk
(
&
Item
::
check_partition_func_processor
,
0
,
(
byte
*
)(
&
part_expression_ok
));
pf_collation_allowed
=
part_expression_ok
;
part_expression_ok
=
1
;
if
(
is_sub_partitioned
()
&&
!
list_of_subpart_fields
)
{
subpart_expr
->
walk
(
&
Item
::
check_partition_func_processor
,
0
,
(
byte
*
)(
&
part_expression_ok
));
}
spf_collation_allowed
=
part_expression_ok
;
}
if
(
!
pf_collation_allowed
||
!
spf_collation_allowed
)
{
my_error
(
ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
,
MYF
(
0
));
goto
end
;
}
}
}
if
(
unlikely
(
!
is_sub_partitioned
()
&&
if
(
unlikely
(
!
is_sub_partitioned
()
&&
!
(
use_default_subpartitions
&&
use_default_no_subpartitions
)))
!
(
use_default_subpartitions
&&
use_default_no_subpartitions
)))
...
...
sql/partition_info.h
View file @
674994b0
...
@@ -250,7 +250,8 @@ public:
...
@@ -250,7 +250,8 @@ public:
bool
check_range_constants
();
bool
check_range_constants
();
bool
check_list_constants
();
bool
check_list_constants
();
bool
check_partition_info
(
THD
*
thd
,
handlerton
**
eng_type
,
bool
check_partition_info
(
THD
*
thd
,
handlerton
**
eng_type
,
handler
*
file
,
HA_CREATE_INFO
*
info
);
handler
*
file
,
HA_CREATE_INFO
*
info
,
bool
check_partition_function
);
void
print_no_partition_found
(
TABLE
*
table
);
void
print_no_partition_found
(
TABLE
*
table
);
private:
private:
static
int
list_part_cmp
(
const
void
*
a
,
const
void
*
b
);
static
int
list_part_cmp
(
const
void
*
a
,
const
void
*
b
);
...
...
sql/sql_partition.cc
View file @
674994b0
...
@@ -525,6 +525,7 @@ static bool set_up_field_array(TABLE *table,
...
@@ -525,6 +525,7 @@ static bool set_up_field_array(TABLE *table,
}
}
/*
/*
Create a field array including all fields of both the partitioning and the
Create a field array including all fields of both the partitioning and the
subpartitioning functions.
subpartitioning functions.
...
@@ -549,6 +550,7 @@ static bool create_full_part_field_array(TABLE *table,
...
@@ -549,6 +550,7 @@ static bool create_full_part_field_array(TABLE *table,
partition_info
*
part_info
)
partition_info
*
part_info
)
{
{
bool
result
=
FALSE
;
bool
result
=
FALSE
;
Field
**
ptr
;
DBUG_ENTER
(
"create_full_part_field_array"
);
DBUG_ENTER
(
"create_full_part_field_array"
);
if
(
!
part_info
->
is_sub_partitioned
())
if
(
!
part_info
->
is_sub_partitioned
())
...
@@ -558,7 +560,7 @@ static bool create_full_part_field_array(TABLE *table,
...
@@ -558,7 +560,7 @@ static bool create_full_part_field_array(TABLE *table,
}
}
else
else
{
{
Field
*
*
ptr
,
*
field
,
**
field_array
;
Field
*
field
,
**
field_array
;
uint
no_part_fields
=
0
,
size_field_array
;
uint
no_part_fields
=
0
,
size_field_array
;
ptr
=
table
->
field
;
ptr
=
table
->
field
;
while
((
field
=
*
(
ptr
++
)))
while
((
field
=
*
(
ptr
++
)))
...
@@ -1369,6 +1371,43 @@ static uint32 get_part_id_from_linear_hash(longlong hash_value, uint mask,
...
@@ -1369,6 +1371,43 @@ static uint32 get_part_id_from_linear_hash(longlong hash_value, uint mask,
return
part_id
;
return
part_id
;
}
}
/*
Check that partition function do not contain any forbidden
character sets and collations.
SYNOPSIS
check_part_func_fields()
part_info Partition info
ptr Array of Field pointers
RETURN VALUES
FALSE Success
TRUE Error
*/
static
bool
check_part_func_fields
(
Field
**
ptr
)
{
Field
*
field
;
while
((
field
=
*
(
ptr
++
)))
{
/*
For CHAR/VARCHAR fields we need to take special precautions.
Binary collation with CHAR is automatically supported. Other
types need some kind of standardisation function handling
*/
if
(
field
->
type
()
==
MYSQL_TYPE_STRING
||
field
->
type
()
==
MYSQL_TYPE_VARCHAR
)
{
CHARSET_INFO
*
cs
=
((
Field_str
*
)
field
)
->
charset
();
if
(
field
->
type
()
==
MYSQL_TYPE_STRING
&&
cs
->
state
&
MY_CS_BINSORT
)
return
FALSE
;
return
TRUE
;
}
}
return
FALSE
;
}
/*
/*
fix partition functions
fix partition functions
...
@@ -1514,6 +1553,13 @@ bool fix_partition_func(THD *thd, TABLE *table,
...
@@ -1514,6 +1553,13 @@ bool fix_partition_func(THD *thd, TABLE *table,
goto
end
;
goto
end
;
}
}
}
}
if
((
check_part_func_fields
(
part_info
->
part_field_array
))
||
(
part_info
->
is_sub_partitioned
()
&&
check_part_func_fields
(
part_info
->
subpart_field_array
)))
{
my_error
(
ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
,
MYF
(
0
));
goto
end
;
}
if
(
unlikely
(
create_full_part_field_array
(
table
,
part_info
)))
if
(
unlikely
(
create_full_part_field_array
(
table
,
part_info
)))
goto
end
;
goto
end
;
if
(
unlikely
(
check_primary_key
(
table
)))
if
(
unlikely
(
check_primary_key
(
table
)))
...
@@ -4533,7 +4579,7 @@ the generated partition syntax in a correct manner.
...
@@ -4533,7 +4579,7 @@ the generated partition syntax in a correct manner.
tab_part_info
->
use_default_no_subpartitions
=
FALSE
;
tab_part_info
->
use_default_no_subpartitions
=
FALSE
;
}
}
if
(
tab_part_info
->
check_partition_info
(
thd
,
(
handlerton
**
)
NULL
,
if
(
tab_part_info
->
check_partition_info
(
thd
,
(
handlerton
**
)
NULL
,
table
->
file
,
ULL
(
0
)))
table
->
file
,
ULL
(
0
)
,
FALSE
))
{
{
DBUG_RETURN
(
TRUE
);
DBUG_RETURN
(
TRUE
);
}
}
...
...
sql/sql_table.cc
View file @
674994b0
...
@@ -3183,7 +3183,8 @@ bool mysql_create_table_internal(THD *thd,
...
@@ -3183,7 +3183,8 @@ bool mysql_create_table_internal(THD *thd,
}
}
DBUG_PRINT
(
"info"
,
(
"db_type = %d"
,
DBUG_PRINT
(
"info"
,
(
"db_type = %d"
,
ha_legacy_type
(
part_info
->
default_engine_type
)));
ha_legacy_type
(
part_info
->
default_engine_type
)));
if
(
part_info
->
check_partition_info
(
thd
,
&
engine_type
,
file
,
create_info
))
if
(
part_info
->
check_partition_info
(
thd
,
&
engine_type
,
file
,
create_info
,
TRUE
))
goto
err
;
goto
err
;
part_info
->
default_engine_type
=
engine_type
;
part_info
->
default_engine_type
=
engine_type
;
...
...
sql/sql_yacc.yy
View file @
674994b0
...
@@ -3637,6 +3637,7 @@ part_bit_expr:
...
@@ -3637,6 +3637,7 @@ part_bit_expr:
{
{
Item *part_expr= $1;
Item *part_expr= $1;
bool not_corr_func;
bool not_corr_func;
int part_expression_ok= 1;
LEX *lex= Lex;
LEX *lex= Lex;
THD *thd= YYTHD;
THD *thd= YYTHD;
longlong item_value;
longlong item_value;
...
@@ -3654,13 +3655,19 @@ part_bit_expr:
...
@@ -3654,13 +3655,19 @@ part_bit_expr:
mem_alloc_error(sizeof(part_elem_value));
mem_alloc_error(sizeof(part_elem_value));
YYABORT;
YYABORT;
}
}
part_expr->walk(&Item::check_partition_func_processor, 0,
(byte*)(&part_expression_ok));
if (!part_expression_ok)
{
my_error(ER_PARTITION_FUNCTION_IS_NOT_ALLOWED, MYF(0));
YYABORT;
}
if (part_expr->fix_fields(YYTHD, (Item**)0) ||
if (part_expr->fix_fields(YYTHD, (Item**)0) ||
((context->table_list= save_list), FALSE) ||
((context->table_list= save_list), FALSE) ||
(!part_expr->const_item()) ||
(!part_expr->const_item()) ||
(!lex->safe_to_cache_query))
(!lex->safe_to_cache_query))
{
{
yyerror(ER(ER_NO_CONST_EXPR_IN_RANGE_OR_LIST_ERROR
));
my_error(ER_NO_CONST_EXPR_IN_RANGE_OR_LIST_ERROR, MYF(0
));
YYABORT;
YYABORT;
}
}
thd->where= save_where;
thd->where= save_where;
...
...
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