Commit 8c083498 authored by Igor Babaev's avatar Igor Babaev

Fixed LP bug #930814.

This bug was introduced into mariadb 5.2 in the December 2010 with
the patch that added a new engine property: the ability to support
virtual columns.    
As a result of this bug the information from frm files for tables 
that contained virtual columns did not appear in the information schema
tables.
parent 028523e9
......@@ -133,3 +133,16 @@ t1 CREATE TABLE `t1` (
`v` char(32) CHARACTER SET ucs2 AS (a) VIRTUAL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
CREATE TABLE t1 (a int, b int);
CREATE TABLE t2 (a int, b int as (a+1) VIRTUAL);
SELECT table_schema, table_name, column_name, column_type, extra
FROM information_schema.columns WHERE table_name = 't1';
table_schema table_name column_name column_type extra
test t1 a int(11)
test t1 b int(11)
SELECT table_schema, table_name, column_name, column_type, extra
FROM information_schema.columns WHERE table_name = 't2';
table_schema table_name column_name column_type extra
test t2 a int(11)
test t2 b int(11) VIRTUAL
DROP TABLE t1,t2;
......@@ -140,3 +140,17 @@ CREATE TABLE t1 (a char(32), v char(32) CHARACTER SET ucs2 AS (a) VIRTUAL);
SHOW CREATE TABLE t1;
DROP TABLE t1;
#
# Bug#930814: no info in information schema for tables with virtual columns
#
CREATE TABLE t1 (a int, b int);
CREATE TABLE t2 (a int, b int as (a+1) VIRTUAL);
SELECT table_schema, table_name, column_name, column_type, extra
FROM information_schema.columns WHERE table_name = 't1';
SELECT table_schema, table_name, column_name, column_type, extra
FROM information_schema.columns WHERE table_name = 't2';
DROP TABLE t1,t2;
......@@ -2339,8 +2339,8 @@ int open_table_from_share(THD *thd, TABLE_SHARE *share, const char *alias,
/* Check virtual columns against table's storage engine. */
if (share->vfields &&
!(outparam->file &&
(outparam->file->ha_table_flags() & HA_CAN_VIRTUAL_COLUMNS)))
(outparam->file &&
!(outparam->file->ha_table_flags() & HA_CAN_VIRTUAL_COLUMNS)))
{
my_error(ER_UNSUPPORTED_ENGINE_FOR_VIRTUAL_COLUMNS, MYF(0),
plugin_name(share->db_plugin)->str);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment