NOTHING is inserted to the Virtual Column. The value specified for it is
ignored. That is the point!
-- Peter
On Mon, Nov 9, 2015 at 11:10 AM, Peter Laursen
wrote:
> I posted this blog:
> http://blog.webyog.com/2015/11/09/beware-virtual-columns-may-render-backups-unusable/.
> It should appear
I posted this blog:
http://blog.webyog.com/2015/11/09/beware-virtual-columns-may-render-backups-unusable/.
It should appear on planet.mysql.com shortly.
-- Peter
On Mon, Nov 9, 2015 at 10:17 AM, Peter Laursen
wrote:
> YES .. it is sql_mode that makes the difference as I realized Friday night
>
YES .. it is sql_mode that makes the difference as I realized Friday night
here..
CREATE TABLE `vc_test`.`t1`(
`id` INT NOT NULL,
`id3` INT AS ( id*3 ) VIRTUAL
);
SET sql_mode = 'strict_all_tables';
INSERT INTO `vc_test`.`t1` VALUES (1,3);
-- returns: Error Code: 1906 - The value specified f
Stupid oversight on my side: it probably depends on sql-mode. I will check
on Monday.
But if this is desired behavior (what I don't think) then at least the
error message is wrong and confusing in strict mode.
-- Peter
On Fri, Nov 6, 2015 at 10:53 AM, Peter Laursen
wrote:
> There are updates i
Hi,
> On 6 Nov 2015, at 07:40, Peter Laursen wrote:
>
> yup .. this is good!
>
> SELECT VERSION(); -- 10.1.8-MariaDB
>
> CREATE DATABASE vctest;
> USE vctest;
>
> CREATE TABLE `t1`(
> `id` INT NOT NULL,
> `id3` INT AS ( id*3 ) VIRTUAL
> );
>
> INSERT INTO `t1` VALUES (1,3);
> -- retru
There are updates in the bug report (http://bugs.mysql.com/bug.php?id=79148).
Those who are interested in the subject should read it.
Unfortunately Oracle chose a client-side and not server-side solution to
this problem. As a consequence 'mysqldumps' from Oracle/MySQL will restore
in MariaDB, but
Further research:
It *does not work* with the .msi package for Windows:
select version();
-- 10.1.8-MariaDB
CREATE TABLE `t1_virtual_uk` (
`f1` int(11) DEFAULT NULL,
`gc` int(11) AS (f1 + 1) VIRTUAL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
insert into `t1_virtual_uk` values (1,2);
-- Error
Correction .. there is no error (except for my copy-paste error). This is
perfect and exactly as I think it should be.
SELECT VERSION(); -- 10.1.8-MariaDB
CREATE DATABASE vctest;
USE vctest;
CREATE TABLE `t1`(
`id` INT NOT NULL,
`id3` INT AS ( id*3 ) VIRTUAL
);
INSERT INTO `t1` VALUES (1,
yup .. this is good!
SELECT VERSION(); -- 10.1.8-MariaDB
CREATE DATABASE vctest;
USE vctest;
CREATE TABLE `t1`(
`id` INT NOT NULL,
`id3` INT AS ( id*3 ) VIRTUAL
);
INSERT INTO `t1` VALUES (1,3);
-- retruns: Error Code: 1906 - The value specified for computed column
'id3' in table 't1' ignor
The insert statement returns a warning:
INSERT INTO `test`.`t1` VALUES (1,3);
Query OK, 1 row affected, 1 warning (0.07 sec)
Warning (Code 1906): The value specified for computed column 'id3' in
table 't1' ignored
On 06/11/2015 08:09, Peter Laursen wrote:
OK, I should have upgraded. But I am
OK, I should have upgraded. But I am currently travelling an with a small
laptop only and an Internet connectivity not fit for downloads (call it a
bad excuse if you want! :-) )
So it actually INSERTS. That is nice. But does it return an error or
warning or nothing? It should not be an error IMO a
06/11/2015 07:51, Peter Laursen wrote:
I reported this bug report to Oracle:
http://bugs.mysql.com/bug.php?id=79148
It is almost the same in MariaDB - but the error message is different, see
SELECT VERSION(); -- 10.1.2-MariaDB-log
CREATE TABLE `vc_test`.`t1`(
`id` INT NOT NULL,
`id3` INT
I reported this bug report to Oracle: http://bugs.mysql.com/bug.php?id=79148
It is almost the same in MariaDB - but the error message is different, see
SELECT VERSION(); -- 10.1.2-MariaDB-log
CREATE TABLE `vc_test`.`t1`(
`id` INT NOT NULL,
`id3` INT AS ( id*3 ) VIRTUAL
);
INSERT INTO `vc_te
13 matches
Mail list logo