[MDEV-15078] Bug with virtual field Created: 2018-01-25  Updated: 2018-01-26  Resolved: 2018-01-26

Status: Closed
Project: MariaDB Server
Component/s: Virtual Columns
Affects Version/s: 10.2.6, 10.2.11
Fix Version/s: 10.2.12

Type: Bug Priority: Major
Reporter: BENLAGHA Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: None
Environment:

Windows 7


Attachments: PNG File ERREUR1.png     JPEG File ERREUR2.jpg    

 Description   

if add more conditions in select i have null in virtual field

CREATE TABLE stocks (
  codeart VARCHAR(20) DEFAULT '',
  num_lot VARCHAR(20) DEFAULT '',
  depot VARCHAR(20) DEFAULT '',
  qte_init DOUBLE DEFAULT 0,
  qte DOUBLE DEFAULT 0,
  cmdclient DOUBLE DEFAULT 0,
  qte_verr DOUBLE DEFAULT 0,
  cmdfour DOUBLE DEFAULT 0,
  rebut DOUBLE DEFAULT 0,
  recycl DOUBLE DEFAULT 0,
  qte_fac_init DOUBLE DEFAULT 0,
  qte_fac DOUBLE DEFAULT 0,
  ug DOUBLE DEFAULT 0,
  pmp_init DOUBLE DEFAULT 0,
  pmp DOUBLE DEFAULT 0,
  pmp_rebut DOUBLE DEFAULT 0,
  pmp_recycl DOUBLE DEFAULT 0,
  valstock DOUBLE AS (`qte` * `pmp`) VIRTUAL,
  valstock_rebut DOUBLE AS (`rebut` * `pmp_rebut`) VIRTUAL,
  valstock_recycl DOUBLE AS (`stocks`.`recycl` * `pmp_recycl`) VIRTUAL,
  qte_dispo DOUBLE AS (`qte` - `cmdclient`) VIRTUAL,
  INDEX IDX_stocks_codeart (codeart),
  INDEX IDX_stocks_depot (depot),
  INDEX IDX_stocks_num_lot (num_lot),
  UNIQUE INDEX UK_stocks (codeart, num_lot, depot)
)
ENGINE = INNODB
AVG_ROW_LENGTH = 655
CHARACTER SET utf8
COLLATE utf8_unicode_ci
ROW_FORMAT = DYNAMIC;



 Comments   
Comment by Elena Stepanova [ 2018-01-26 ]

This problem was fixed in 10.2.12 release by this commit:

commit 7e882a60bfb116e40df89e793c2b71decbe82f6d
Author: Monty <monty@mariadb.org>
Date:   Mon Jan 1 14:44:20 2018 +0200
 
    Ensure that table->vcol_set is properly restored if used
    
    Code in QUICK_RANGE_SELECT::init_ror_merged_scan() could theoretically
    have caused crashes if this was ever called from an update or delete
    
    This also found a bug in the vcol/range.result. file.

Generated at Thu Feb 08 08:18:31 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.