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
0a056c9b
Commit
0a056c9b
authored
Jun 27, 2016
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
better ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED
parent
1b4f0962
Changes
22
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
213 additions
and
186 deletions
+213
-186
mysql-test/r/default.result
mysql-test/r/default.result
+38
-38
mysql-test/r/func_gconcat.result
mysql-test/r/func_gconcat.result
+2
-2
mysql-test/r/gis-debug.result
mysql-test/r/gis-debug.result
+1
-1
mysql-test/r/win.result
mysql-test/r/win.result
+1
-1
mysql-test/suite/rpl/r/rpl_gtid_basic.result
mysql-test/suite/rpl/r/rpl_gtid_basic.result
+1
-1
mysql-test/suite/vcol/r/not_supported.result
mysql-test/suite/vcol/r/not_supported.result
+8
-8
mysql-test/suite/vcol/r/vcol_blocked_sql_funcs.result
mysql-test/suite/vcol/r/vcol_blocked_sql_funcs.result
+75
-75
mysql-test/t/default.test
mysql-test/t/default.test
+1
-1
sql/field.cc
sql/field.cc
+1
-1
sql/item.cc
sql/item.cc
+17
-0
sql/item.h
sql/item.h
+10
-6
sql/item_func.cc
sql/item_func.cc
+13
-0
sql/item_func.h
sql/item_func.h
+19
-28
sql/item_geofunc.h
sql/item_geofunc.h
+1
-1
sql/item_strfunc.h
sql/item_strfunc.h
+3
-3
sql/item_subselect.h
sql/item_subselect.h
+1
-1
sql/item_sum.cc
sql/item_sum.cc
+6
-0
sql/item_sum.h
sql/item_sum.h
+2
-6
sql/item_timefunc.h
sql/item_timefunc.h
+9
-9
sql/item_windowfunc.h
sql/item_windowfunc.h
+1
-1
sql/share/errmsg-utf8.txt
sql/share/errmsg-utf8.txt
+2
-2
sql/table.cc
sql/table.cc
+1
-1
No files found.
mysql-test/r/default.result
View file @
0a056c9b
This diff is collapsed.
Click to expand it.
mysql-test/r/func_gconcat.result
View file @
0a056c9b
...
...
@@ -473,9 +473,9 @@ select collation(group_concat(a,_koi8r'test')) from t1;
collation(group_concat(a,_koi8r'test'))
cp1250_general_ci
select collation(group_concat(a,_koi8r 0xC1C2)) from t1;
ERROR HY000: Illegal mix of collations (cp1250_general_ci,IMPLICIT) and (koi8r_general_ci,COERCIBLE) for operation 'group_concat'
ERROR HY000: Illegal mix of collations (cp1250_general_ci,IMPLICIT) and (koi8r_general_ci,COERCIBLE) for operation 'group_concat
(
'
select collation(group_concat(a,b)) from t1;
ERROR HY000: Illegal mix of collations (cp1250_general_ci,IMPLICIT) and (koi8r_general_ci,IMPLICIT) for operation 'group_concat'
ERROR HY000: Illegal mix of collations (cp1250_general_ci,IMPLICIT) and (koi8r_general_ci,IMPLICIT) for operation 'group_concat
(
'
drop table t1;
drop table t2;
CREATE TABLE t1 (a CHAR(10) CHARACTER SET cp850);
...
...
mysql-test/r/gis-debug.result
View file @
0a056c9b
...
...
@@ -301,7 +301,7 @@ POLYGON((9 9,5 2,4 5,9 9))
# MDEV-10134 Add full support for DEFAULT
#
CREATE TABLE t1 (a INT DEFAULT ST_GIS_DEBUG(1));
ERROR HY000: Function or expression 'st_gis_debug
' is not allowed for 'DEFAULT' of column/constraint 'a'
ERROR HY000: Function or expression 'st_gis_debug
()' cannot be used in the DEFAULT clause of `a`
#
# End of 10.2 tests
#
mysql-test/r/win.result
View file @
0a056c9b
...
...
@@ -456,7 +456,7 @@ pk, c,
row_number() over (partition by c order by pk
range between unbounded preceding and current row) as r
from t1;
ERROR HY000: Window frame is not allowed with 'row_number'
ERROR HY000: Window frame is not allowed with 'row_number
(
'
select
pk, c,
rank() over w1 as r
...
...
mysql-test/suite/rpl/r/rpl_gtid_basic.result
View file @
0a056c9b
...
...
@@ -562,7 +562,7 @@ include/rpl_end.inc
# MDEV-10134 Add full support for DEFAULT
#
CREATE TABLE t1 (a VARCHAR(100) DEFAULT BINLOG_GTID_POS("master-bin.000001", 600));
ERROR HY000: Function or expression 'binlog_gtid_pos
' is not allowed for 'DEFAULT' of column/constraint 'a'
ERROR HY000: Function or expression 'binlog_gtid_pos
()' cannot be used in the DEFAULT clause of `a`
#
# End of 10.2 tests
#
mysql-test/suite/vcol/r/not_supported.result
View file @
0a056c9b
...
...
@@ -4,22 +4,22 @@ set time_zone='+10:00';
set div_precision_increment=20;
create table t1 (a int, b int, v decimal(20,19) as (a/3));
create table t2 (a int, b int, v int as (a+@a));
ERROR HY000: Function or expression '
user_var' is not allowed for 'VIRTUAL' of column/constraint 'v'
ERROR HY000: Function or expression '
@a' cannot be used in the GENERATED ALWAYS AS clause of `v`
create table t2 (a int, b int, v int as (a+@a) PERSISTENT);
ERROR HY000: Function or expression '
user_var' is not allowed for 'VIRTUAL' of column/constraint 'v'
ERROR HY000: Function or expression '
@a' cannot be used in the GENERATED ALWAYS AS clause of `v`
create table t3_ok (a int, b int, v int as (a+@@error_count));
create table t3 (a int, b int, v int as (a+@@error_count) PERSISTENT);
ERROR HY000: Function or expression '
get_system_var' is not allowed for 'VIRTUAL' of column/constraint 'v'
ERROR HY000: Function or expression '
@@error_count' cannot be used in the GENERATED ALWAYS AS clause of `v`
create table t4 (a int, b int, v int as (@a:=a));
ERROR HY000: Function or expression '
user_var' is not allowed for 'VIRTUAL' of column/constraint 'v'
ERROR HY000: Function or expression '
@a' cannot be used in the GENERATED ALWAYS AS clause of `v`
create table t4 (a int, b int, v int as (@a:=a) PERSISTENT);
ERROR HY000: Function or expression '
user_var' is not allowed for 'VIRTUAL' of column/constraint 'v'
ERROR HY000: Function or expression '
@a' cannot be used in the GENERATED ALWAYS AS clause of `v`
create table t5 (a int, b int, v varchar(100) as (monthname(a)));
ERROR HY000: Function or expression 'monthname
' is not allowed for 'VIRTUAL' of column/constraint 'v'
ERROR HY000: Function or expression 'monthname
()' cannot be used in the GENERATED ALWAYS AS clause of `v`
create table t6 (a int, b int, v varchar(100) as (dayname(a)));
ERROR HY000: Function or expression 'dayname
' is not allowed for 'VIRTUAL' of column/constraint 'v'
ERROR HY000: Function or expression 'dayname
()' cannot be used in the GENERATED ALWAYS AS clause of `v`
create table t7 (a int, b int, v varchar(100) as (date_format(a, '%W %a %M %b')));
ERROR HY000: Function or expression 'date_format
' is not allowed for 'VIRTUAL' of column/constraint 'v'
ERROR HY000: Function or expression 'date_format
()' cannot be used in the GENERATED ALWAYS AS clause of `v`
create table t8 (a int, b int, v varchar(100) as (from_unixtime(a)));
insert t1 (a,b) values (1,2);
insert t8 (a,b) values (1234567890,2);
...
...
mysql-test/suite/vcol/r/vcol_blocked_sql_funcs.result
View file @
0a056c9b
This diff is collapsed.
Click to expand it.
mysql-test/t/default.test
View file @
0a056c9b
...
...
@@ -288,7 +288,7 @@ create or replace table t1 (a int as (b), b int default 1);
create
or
replace
table
t1
(
a
int
as
(
b
),
b
int
default
(
1
+
1
));
create
or
replace
table
t1
(
a
int
default
1
,
b
int
as
(
c
),
c
int
default
(
a
+
1
));
create
or
replace
table
t1
(
a
int
default
(
1
+
1
),
b
int
as
(
c
),
c
int
default
(
a
+
1
));
create
or
replace
table
t1
(
a
VARCHAR
(
128
)
DEFAULT
@@
version
);
create
or
replace
table
t1
(
a
varchar
(
128
)
default
@@
version
);
create
or
replace
table
t1
(
a
int
not
null
,
b
int
as
(
a
));
create
or
replace
table
t1
(
a
int
not
null
,
b
int
default
(
a
+
1
));
...
...
sql/field.cc
View file @
0a056c9b
...
...
@@ -9798,7 +9798,7 @@ bool Column_definition::check(THD *thd)
if
(
vcol_info
)
{
vcol_info
->
set_field_type
(
sql_type
);
if
(
check_expression
(
vcol_info
,
"
VIRTUAL
"
,
field_name
,
if
(
check_expression
(
vcol_info
,
"
GENERATED ALWAYS AS
"
,
field_name
,
vcol_info
->
stored_in_db
))
DBUG_RETURN
(
TRUE
);
}
...
...
sql/item.cc
View file @
0a056c9b
...
...
@@ -1422,6 +1422,16 @@ bool mark_unsupported_function(const char *where, void *store, uint result)
return
false
;
}
/* convenience helper for mark_unsupported_function() above */
bool
mark_unsupported_function
(
const
char
*
w1
,
const
char
*
w2
,
void
*
store
,
uint
result
)
{
char
*
ptr
=
(
char
*
)
current_thd
->
alloc
(
strlen
(
w1
)
+
strlen
(
w2
)
+
1
);
if
(
ptr
)
strxmov
(
ptr
,
w1
,
w2
,
NullS
);
return
mark_unsupported_function
(
ptr
,
store
,
result
);
}
/*****************************************************************************
Item_sp_variable methods
*****************************************************************************/
...
...
@@ -8583,6 +8593,13 @@ void Item_trigger_field::print(String *str, enum_query_type query_type)
}
bool
Item_trigger_field
::
check_vcol_func_processor
(
void
*
arg
)
{
const
char
*
ver
=
row_version
==
NEW_ROW
?
"NEW."
:
"OLD."
;
return
mark_unsupported_function
(
ver
,
field_name
,
arg
,
VCOL_IMPOSSIBLE
);
}
void
Item_trigger_field
::
cleanup
()
{
want_privilege
=
original_privilege
;
...
...
sql/item.h
View file @
0a056c9b
...
...
@@ -62,6 +62,9 @@ char_to_byte_length_safe(uint32 char_length_arg, uint32 mbmaxlen_arg)
bool
mark_unsupported_function
(
const
char
*
where
,
void
*
store
,
uint
result
);
/* convenience helper for mark_unsupported_function() above */
bool
mark_unsupported_function
(
const
char
*
w1
,
const
char
*
w2
,
void
*
store
,
uint
result
);
/* Bits for the split_sum_func() function */
#define SPLIT_SUM_SKIP_REGISTERED 1
/* Skip registered funcs */
...
...
@@ -2032,6 +2035,10 @@ class Item_sp_variable :public Item
inline
int
save_in_field
(
Field
*
field
,
bool
no_conversions
);
inline
bool
send
(
Protocol
*
protocol
,
String
*
str
);
bool
check_vcol_func_processor
(
void
*
arg
)
{
return
mark_unsupported_function
(
m_name
.
str
,
arg
,
VCOL_IMPOSSIBLE
);
}
};
/*****************************************************************************
...
...
@@ -2239,7 +2246,7 @@ class Item_name_const : public Item
}
bool
check_vcol_func_processor
(
void
*
arg
)
{
return
mark_unsupported_function
(
"name_const"
,
arg
,
VCOL_IMPOSSIBLE
);
return
mark_unsupported_function
(
"name_const
()
"
,
arg
,
VCOL_IMPOSSIBLE
);
}
};
...
...
@@ -4936,7 +4943,7 @@ class Item_insert_value : public Item_field
bool
check_partition_func_processor
(
void
*
int_arg
)
{
return
TRUE
;}
bool
check_vcol_func_processor
(
void
*
arg
)
{
return
mark_unsupported_function
(
"values"
,
arg
,
VCOL_IMPOSSIBLE
);
return
mark_unsupported_function
(
"values
()
"
,
arg
,
VCOL_IMPOSSIBLE
);
}
};
...
...
@@ -5023,10 +5030,7 @@ class Item_trigger_field : public Item_field,
*/
bool
read_only
;
public:
bool
check_vcol_func_processor
(
void
*
arg
)
{
return
mark_unsupported_function
(
"trigger"
,
arg
,
VCOL_IMPOSSIBLE
);
}
bool
check_vcol_func_processor
(
void
*
arg
);
};
...
...
sql/item_func.cc
View file @
0a056c9b
...
...
@@ -4587,6 +4587,11 @@ longlong Item_func_sleep::val_int()
}
bool
Item_func_user_var
::
check_vcol_func_processor
(
void
*
arg
)
{
return
mark_unsupported_function
(
"@"
,
name
.
str
,
arg
,
VCOL_IMPOSSIBLE
);
}
#define extra_size sizeof(double)
user_var_entry
*
get_variable
(
HASH
*
hash
,
LEX_STRING
&
name
,
...
...
@@ -5847,6 +5852,10 @@ void Item_func_get_system_var::print(String *str, enum_query_type query_type)
str
->
append
(
name
,
name_length
);
}
bool
Item_func_get_system_var
::
check_vcol_func_processor
(
void
*
arg
)
{
return
mark_unsupported_function
(
"@@"
,
var
->
name
.
str
,
arg
,
VCOL_NON_DETERMINISTIC
);
}
enum
Item_result
Item_func_get_system_var
::
result_type
()
const
{
...
...
@@ -6850,6 +6859,10 @@ void Item_func_sp::update_used_tables()
}
}
bool
Item_func_sp
::
check_vcol_func_processor
(
void
*
arg
)
{
return
mark_unsupported_function
(
func_name
(),
"()"
,
arg
,
VCOL_IMPOSSIBLE
);
}
/*
uuid_short handling.
...
...
sql/item_func.h
View file @
0a056c9b
...
...
@@ -614,7 +614,7 @@ class Item_func_connection_id :public Item_int_func
longlong
val_int
()
{
DBUG_ASSERT
(
fixed
==
1
);
return
value
;
}
bool
check_vcol_func_processor
(
void
*
arg
)
{
return
mark_unsupported_function
(
func_name
(),
arg
,
VCOL_NON_DETERMINISTIC
);
return
mark_unsupported_function
(
func_name
(),
"()"
,
arg
,
VCOL_NON_DETERMINISTIC
);
}
};
...
...
@@ -1041,7 +1041,7 @@ class Item_func_rand :public Item_real_func
void
cleanup
()
{
first_eval
=
TRUE
;
Item_real_func
::
cleanup
();
}
bool
check_vcol_func_processor
(
void
*
arg
)
{
return
mark_unsupported_function
(
func_name
(),
arg
,
VCOL_NON_DETERMINISTIC
);
return
mark_unsupported_function
(
func_name
(),
"()"
,
arg
,
VCOL_NON_DETERMINISTIC
);
}
private:
void
seed_random
(
Item
*
val
);
...
...
@@ -1337,7 +1337,7 @@ class Item_func_last_insert_id :public Item_int_func
bool
fix_fields
(
THD
*
thd
,
Item
**
ref
);
bool
check_vcol_func_processor
(
void
*
arg
)
{
return
mark_unsupported_function
(
func_name
(),
arg
,
VCOL_IMPOSSIBLE
);
return
mark_unsupported_function
(
func_name
(),
"()"
,
arg
,
VCOL_IMPOSSIBLE
);
}
};
...
...
@@ -1354,7 +1354,7 @@ class Item_func_benchmark :public Item_int_func
virtual
void
print
(
String
*
str
,
enum_query_type
query_type
);
bool
check_vcol_func_processor
(
void
*
arg
)
{
return
mark_unsupported_function
(
func_name
(),
arg
,
VCOL_IMPOSSIBLE
);
return
mark_unsupported_function
(
func_name
(),
"()"
,
arg
,
VCOL_IMPOSSIBLE
);
}
};
...
...
@@ -1376,7 +1376,7 @@ class Item_func_sleep :public Item_int_func
longlong
val_int
();
bool
check_vcol_func_processor
(
void
*
arg
)
{
return
mark_unsupported_function
(
func_name
(),
arg
,
VCOL_IMPOSSIBLE
);
return
mark_unsupported_function
(
func_name
(),
"()"
,
arg
,
VCOL_IMPOSSIBLE
);
}
};
...
...
@@ -1471,7 +1471,7 @@ class Item_udf_func :public Item_func
virtual
void
print
(
String
*
str
,
enum_query_type
query_type
);
bool
check_vcol_func_processor
(
void
*
arg
)
{
return
mark_unsupported_function
(
func_name
(),
arg
,
VCOL_UNKNOWN
);
return
mark_unsupported_function
(
func_name
(),
"()"
,
arg
,
VCOL_UNKNOWN
);
}
};
...
...
@@ -1646,7 +1646,7 @@ class Item_func_get_lock :public Item_int_func
bool
is_expensive
()
{
return
1
;
}
bool
check_vcol_func_processor
(
void
*
arg
)
{
return
mark_unsupported_function
(
func_name
(),
arg
,
VCOL_IMPOSSIBLE
);
return
mark_unsupported_function
(
func_name
(),
"()"
,
arg
,
VCOL_IMPOSSIBLE
);
}
};
...
...
@@ -1666,7 +1666,7 @@ class Item_func_release_lock :public Item_int_func
bool
is_expensive
()
{
return
1
;
}
bool
check_vcol_func_processor
(
void
*
arg
)
{
return
mark_unsupported_function
(
func_name
(),
arg
,
VCOL_IMPOSSIBLE
);
return
mark_unsupported_function
(
func_name
(),
"()"
,
arg
,
VCOL_IMPOSSIBLE
);
}
};
...
...
@@ -1686,7 +1686,7 @@ class Item_master_pos_wait :public Item_int_func
void
fix_length_and_dec
()
{
max_length
=
21
;
maybe_null
=
1
;}
bool
check_vcol_func_processor
(
void
*
arg
)
{
return
mark_unsupported_function
(
func_name
(),
arg
,
VCOL_IMPOSSIBLE
);
return
mark_unsupported_function
(
func_name
(),
"()"
,
arg
,
VCOL_IMPOSSIBLE
);
}
};
...
...
@@ -1702,7 +1702,7 @@ class Item_master_gtid_wait :public Item_int_func
void
fix_length_and_dec
()
{
max_length
=
10
+
1
+
10
+
1
+
20
+
1
;
maybe_null
=
0
;}
bool
check_vcol_func_processor
(
void
*
arg
)
{
return
mark_unsupported_function
(
func_name
(),
arg
,
VCOL_IMPOSSIBLE
);
return
mark_unsupported_function
(
func_name
(),
"()"
,
arg
,
VCOL_IMPOSSIBLE
);
}
};
...
...
@@ -1728,10 +1728,7 @@ class Item_func_user_var :public Item_hybrid_func
Item_func_user_var
(
THD
*
thd
,
Item_func_user_var
*
item
)
:
Item_hybrid_func
(
thd
,
item
),
m_var_entry
(
item
->
m_var_entry
),
name
(
item
->
name
)
{
}
bool
check_vcol_func_processor
(
void
*
arg
)
{
return
mark_unsupported_function
(
"user_var"
,
arg
,
VCOL_IMPOSSIBLE
);
}
bool
check_vcol_func_processor
(
void
*
arg
);
};
...
...
@@ -1938,10 +1935,7 @@ class Item_func_get_system_var :public Item_func
bool
eq
(
const
Item
*
item
,
bool
binary_cmp
)
const
;
void
cleanup
();
bool
check_vcol_func_processor
(
void
*
arg
)
{
return
mark_unsupported_function
(
func_name
(),
arg
,
VCOL_NON_DETERMINISTIC
);
}
bool
check_vcol_func_processor
(
void
*
arg
);
};
...
...
@@ -1989,7 +1983,7 @@ class Item_func_match :public Item_real_func
void
init_search
(
THD
*
thd
,
bool
no_order
);
bool
check_vcol_func_processor
(
void
*
arg
)
{
return
mark_unsupported_function
(
func_name
()
,
arg
,
VCOL_IMPOSSIBLE
);
return
mark_unsupported_function
(
"match ... against()"
,
arg
,
VCOL_IMPOSSIBLE
);
}
private:
/**
...
...
@@ -2046,7 +2040,7 @@ class Item_func_is_free_lock :public Item_int_func
void
fix_length_and_dec
()
{
decimals
=
0
;
max_length
=
1
;
maybe_null
=
1
;}
bool
check_vcol_func_processor
(
void
*
arg
)
{
return
mark_unsupported_function
(
func_name
(),
arg
,
VCOL_IMPOSSIBLE
);
return
mark_unsupported_function
(
func_name
(),
"()"
,
arg
,
VCOL_IMPOSSIBLE
);
}
};
...
...
@@ -2060,7 +2054,7 @@ class Item_func_is_used_lock :public Item_int_func
void
fix_length_and_dec
()
{
decimals
=
0
;
max_length
=
10
;
maybe_null
=
1
;}
bool
check_vcol_func_processor
(
void
*
arg
)
{
return
mark_unsupported_function
(
func_name
(),
arg
,
VCOL_IMPOSSIBLE
);
return
mark_unsupported_function
(
func_name
(),
"()"
,
arg
,
VCOL_IMPOSSIBLE
);
}
};
...
...
@@ -2110,7 +2104,7 @@ class Item_func_row_count :public Item_int_func
void
fix_length_and_dec
()
{
decimals
=
0
;
maybe_null
=
0
;
}
bool
check_vcol_func_processor
(
void
*
arg
)
{
return
mark_unsupported_function
(
func_name
(),
arg
,
VCOL_IMPOSSIBLE
);
return
mark_unsupported_function
(
func_name
(),
"()"
,
arg
,
VCOL_IMPOSSIBLE
);
}
};
...
...
@@ -2234,10 +2228,7 @@ class Item_func_sp :public Item_func
return
sp_result_field
;
}
bool
check_vcol_func_processor
(
void
*
arg
)
{
return
mark_unsupported_function
(
func_name
(),
arg
,
VCOL_IMPOSSIBLE
);
}
bool
check_vcol_func_processor
(
void
*
arg
);
bool
limit_index_condition_pushdown_processor
(
void
*
opt_arg
)
{
return
TRUE
;
...
...
@@ -2254,7 +2245,7 @@ class Item_func_found_rows :public Item_int_func
void
fix_length_and_dec
()
{
decimals
=
0
;
maybe_null
=
0
;
}
bool
check_vcol_func_processor
(
void
*
arg
)
{
return
mark_unsupported_function
(
func_name
(),
arg
,
VCOL_IMPOSSIBLE
);
return
mark_unsupported_function
(
func_name
(),
"()"
,
arg
,
VCOL_IMPOSSIBLE
);
}
};
...
...
@@ -2272,7 +2263,7 @@ class Item_func_uuid_short :public Item_int_func
table_map
used_tables
()
const
{
return
RAND_TABLE_BIT
;
}
bool
check_vcol_func_processor
(
void
*
arg
)
{
return
mark_unsupported_function
(
func_name
(),
arg
,
VCOL_NON_DETERMINISTIC
);
return
mark_unsupported_function
(
func_name
(),
"()"
,
arg
,
VCOL_NON_DETERMINISTIC
);
}
};
...
...
sql/item_geofunc.h
View file @
0a056c9b
...
...
@@ -618,7 +618,7 @@ class Item_func_gis_debug: public Item_int_func
longlong
val_int
();
bool
check_vcol_func_processor
(
void
*
arg
)
{
return
mark_unsupported_function
(
func_name
(),
arg
,
VCOL_IMPOSSIBLE
);
return
mark_unsupported_function
(
func_name
(),
"()"
,
arg
,
VCOL_IMPOSSIBLE
);
}
};
#endif
...
...
sql/item_strfunc.h
View file @
0a056c9b
...
...
@@ -763,7 +763,7 @@ class Item_func_binlog_gtid_pos :public Item_str_func
const
char
*
func_name
()
const
{
return
"binlog_gtid_pos"
;
}
bool
check_vcol_func_processor
(
void
*
arg
)
{
return
mark_unsupported_function
(
func_name
(),
arg
,
VCOL_IMPOSSIBLE
);
return
mark_unsupported_function
(
func_name
(),
"()"
,
arg
,
VCOL_IMPOSSIBLE
);
}
};
...
...
@@ -923,7 +923,7 @@ class Item_load_file :public Item_str_func
}
bool
check_vcol_func_processor
(
void
*
arg
)
{
return
mark_unsupported_function
(
func_name
(),
arg
,
VCOL_IMPOSSIBLE
);
return
mark_unsupported_function
(
func_name
(),
"()"
,
arg
,
VCOL_IMPOSSIBLE
);
}
};
...
...
@@ -1191,7 +1191,7 @@ class Item_func_uuid: public Item_str_func
String
*
val_str
(
String
*
);
bool
check_vcol_func_processor
(
void
*
arg
)
{
return
mark_unsupported_function
(
func_name
(),
arg
,
VCOL_NON_DETERMINISTIC
);
return
mark_unsupported_function
(
func_name
(),
"()"
,
arg
,
VCOL_NON_DETERMINISTIC
);
}
};
...
...
sql/item_subselect.h
View file @
0a056c9b
...
...
@@ -222,7 +222,7 @@ class Item_subselect :public Item_result_field,
bool
enumerate_field_refs_processor
(
void
*
arg
);
bool
check_vcol_func_processor
(
void
*
arg
)
{
return
mark_unsupported_function
(
"s
ubselect
"
,
arg
,
VCOL_IMPOSSIBLE
);
return
mark_unsupported_function
(
"s
elect ...
"
,
arg
,
VCOL_IMPOSSIBLE
);
}
/**
Callback to test if an IN predicate is expensive.
...
...
sql/item_sum.cc
View file @
0a056c9b
...
...
@@ -579,6 +579,12 @@ Item *Item_sum::result_item(THD *thd, Field *field)
return
new
(
thd
->
mem_root
)
Item_field
(
thd
,
field
);
}
bool
Item_sum
::
check_vcol_func_processor
(
void
*
arg
)
{
return
mark_unsupported_function
(
func_name
(),
")"
,
arg
,
VCOL_IMPOSSIBLE
);
}
/**
Compare keys consisting of single field that cannot be compared as binary.
...
...
sql/item_sum.h
View file @
0a056c9b
...
...
@@ -547,11 +547,7 @@ class Item_sum :public Item_func_or_sum
virtual
void
remove
()
{
DBUG_ASSERT
(
0
);
}
virtual
void
cleanup
();
bool
check_vcol_func_processor
(
void
*
arg
)
{
return
mark_unsupported_function
(
func_name
(),
arg
,
VCOL_IMPOSSIBLE
);
}
bool
check_vcol_func_processor
(
void
*
arg
);
virtual
void
setup_window_func
(
THD
*
thd
,
Window_spec
*
window_spec
)
{}
};
...
...
@@ -1555,7 +1551,7 @@ class Item_func_group_concat : public Item_sum
void
cleanup
();
enum
Sumfunctype
sum_func
()
const
{
return
GROUP_CONCAT_FUNC
;}
const
char
*
func_name
()
const
{
return
"group_concat"
;
}
const
char
*
func_name
()
const
{
return
"group_concat
(
"
;
}
virtual
Item_result
result_type
()
const
{
return
STRING_RESULT
;
}
virtual
Item_result
cmp_type
()
const
{
return
STRING_RESULT
;
}
enum_field_types
field_type
()
const
...
...
sql/item_timefunc.h
View file @
0a056c9b
...
...
@@ -196,7 +196,7 @@ class Item_func_monthname :public Item_str_func
}
bool
check_vcol_func_processor
(
void
*
arg
)
{
return
mark_unsupported_function
(
func_name
(),
arg
,
VCOL_IMPOSSIBLE
);
return
mark_unsupported_function
(
func_name
(),
"()"
,
arg
,
VCOL_IMPOSSIBLE
);
}
};
...
...
@@ -411,7 +411,7 @@ class Item_func_dayname :public Item_func_weekday
bool
check_partition_func_processor
(
void
*
int_arg
)
{
return
TRUE
;}
bool
check_vcol_func_processor
(
void
*
arg
)
{
return
mark_unsupported_function
(
func_name
(),
arg
,
VCOL_IMPOSSIBLE
);
return
mark_unsupported_function
(
func_name
(),
"()"
,
arg
,
VCOL_IMPOSSIBLE
);
}
};
...
...
@@ -464,7 +464,7 @@ class Item_func_unix_timestamp :public Item_func_seconds_hybrid
{
if
(
arg_count
)
return
FALSE
;
return
mark_unsupported_function
(
func_name
(),
arg
,
VCOL_TIME_FUNC
);
return
mark_unsupported_function
(
func_name
(),
"()"
,
arg
,
VCOL_TIME_FUNC
);
}
longlong
int_op
();
my_decimal
*
decimal_op
(
my_decimal
*
buf
);
...
...
@@ -614,7 +614,7 @@ class Item_func_curtime :public Item_timefunc
virtual
void
store_now_in_TIME
(
THD
*
thd
,
MYSQL_TIME
*
now_time
)
=
0
;
bool
check_vcol_func_processor
(
void
*
arg
)
{
return
mark_unsupported_function
(
func_name
(),
arg
,
VCOL_TIME_FUNC
);
return
mark_unsupported_function
(
func_name
(),
"()"
,
arg
,
VCOL_TIME_FUNC
);
}
};
...
...
@@ -649,7 +649,7 @@ class Item_func_curdate :public Item_datefunc
virtual
void
store_now_in_TIME
(
THD
*
thd
,
MYSQL_TIME
*
now_time
)
=
0
;
bool
check_vcol_func_processor
(
void
*
arg
)
{
return
mark_unsupported_function
(
func_name
(),
arg
,
return
mark_unsupported_function
(
func_name
(),
"()"
,
arg
,
VCOL_TIME_FUNC
);
}
};
...
...
@@ -691,7 +691,7 @@ class Item_func_now :public Item_datetimefunc
NOW is safe for replication as slaves will run with same time as
master
*/
return
mark_unsupported_function
(
func_name
(),
arg
,
VCOL_TIME_FUNC
);
return
mark_unsupported_function
(
func_name
(),
"()"
,
arg
,
VCOL_TIME_FUNC
);
}
};
...
...
@@ -715,7 +715,7 @@ class Item_func_now_utc :public Item_func_now
virtual
enum
Functype
functype
()
const
{
return
NOW_UTC_FUNC
;
}
virtual
bool
check_vcol_func_processor
(
void
*
arg
)
{
return
mark_unsupported_function
(
func_name
(),
arg
,
return
mark_unsupported_function
(
func_name
(),
"()"
,
arg
,
VCOL_TIME_FUNC
|
VCOL_NON_DETERMINISTIC
);
}
...
...
@@ -737,7 +737,7 @@ class Item_func_sysdate_local :public Item_func_now
table_map
used_tables
()
const
{
return
RAND_TABLE_BIT
;
}
bool
check_vcol_func_processor
(
void
*
arg
)
{
return
mark_unsupported_function
(
func_name
(),
arg
,
return
mark_unsupported_function
(
func_name
(),
"()"
,
arg
,
VCOL_TIME_FUNC
|
VCOL_NON_DETERMINISTIC
);
}
virtual
enum
Functype
functype
()
const
{
return
SYSDATE_FUNC
;
}
...
...
@@ -776,7 +776,7 @@ class Item_func_date_format :public Item_str_func
bool
eq
(
const
Item
*
item
,
bool
binary_cmp
)
const
;
bool
check_vcol_func_processor
(
void
*
arg
)
{
return
mark_unsupported_function
(
func_name
(),
arg
,
VCOL_IMPOSSIBLE
);
return
mark_unsupported_function
(
func_name
(),
"()"
,
arg
,
VCOL_IMPOSSIBLE
);
}
};
...
...
sql/item_windowfunc.h
View file @
0a056c9b
...
...
@@ -117,7 +117,7 @@ class Item_sum_row_number: public Item_sum_int
}
const
char
*
func_name
()
const
{
return
"row_number"
;
return
"row_number
(
"
;
}
};
...
...
sql/share/errmsg-utf8.txt
View file @
0a056c9b
...
...
@@ -6970,7 +6970,7 @@ start-error-number 1900
ER_VCOL_BASED_ON_VCOL
eng "A computed column cannot be based on a computed column"
ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED
eng "Function or expression '%s'
is not allowed for '%s' of column/constraint '%s'
"
eng "Function or expression '%s'
cannot be used in the %s clause of %`s
"
ER_DATA_CONVERSION_ERROR_FOR_VIRTUAL_COLUMN
eng "Generated value for computed column '%s' cannot be converted to type '%s'"
ER_PRIMARY_KEY_BASED_ON_VIRTUAL_COLUMN
...
...
@@ -7209,7 +7209,7 @@ ER_CONSTRAINT_FAILED 23000
rus "проверка CONSTRAINT %`s для %`-.192s.%`-.192s провалилась"
ukr "Перевірка CONSTRAINT %`s для %`-.192s.%`-.192s не пройшла"
ER_EXPRESSION_IS_TOO_BIG
eng "%s expression i
s too big for '%s'
"
eng "%s expression i
n the %s clause is too big
"
ER_ERROR_EVALUATING_EXPRESSION
eng "Got an error evaluating stored expression %`s"
ER_CALCULATING_DEFAULT_VALUE
...
...
sql/table.cc
View file @
0a056c9b
...
...
@@ -2614,7 +2614,7 @@ static bool fix_vcol_expr(THD *thd,
if
(
error
||
(
res
.
errors
&
VCOL_IMPOSSIBLE
))
{
my_error
(
ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED
,
MYF
(
0
),
res
.
name
,
field_name
);
"???"
,
field_name
);
goto
end
;
}
#endif
...
...
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