[MDEV-23716] FK validate data but in select join tables parent and child don't search data Created: 2020-09-11  Updated: 2020-09-17  Resolved: 2020-09-17

Status: Closed
Project: MariaDB Server
Component/s: Character Sets
Affects Version/s: None
Fix Version/s: N/A

Type: Bug Priority: Major
Reporter: kmesen@hotmail.com Assignee: Unassigned
Resolution: Not a Bug Votes: 0
Labels: upstream

Issue Links:
Relates
relates to MDEV-22361 Cross-engine foreign keys support Open

 Description   

I have two tables

CREATE TABLE parent (
  `cod_cta` VARCHAR(30) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `des_cta` VARCHAR(100),
   PRIMARY KEY (`cod_neg`,`cod_cta`),
) ENGINE=INNODB;
 
CREATE TABLE child (
  `cod_asi` INT(11) NOT NULL DEFAULT 0,
  `num_lin` INT(11) NOT NULL DEFAULT 0,
  `cod_cta` VARCHAR(30) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  PRIMARY KEY (`cod_asi`,`num_lin`),
  CONSTRAINT `fk_child_cta` FOREIGN KEY (`cod_cta`) REFERENCES parent ( `cod_cta`) ENGINE=INNODB;

when I insert a new row in child table, FK OK data with trailing spaces, but when I join both tables in a select data dont retrieve any data.

thanks!



 Comments   
Comment by Alice Sherepa [ 2020-09-14 ]

Could you please demonstrate the full problem and add your .cnf file(s)? I guess you overedited table definitions, cod_neg in the parent table is missing, in the child table constraint will return error because in index cod_cta is not on the first place. What version of MariaDB do you use?

Comment by kmesen@hotmail.com [ 2020-09-15 ]

Thanks for your atention, when I checked the tables, data's child table were inserted with SET FOREIGN_KEY_CHECKS =0
I tryed to reproduce the reported case but is not posible!
I apologize for the false problem!
Thanks!

Generated at Thu Feb 08 09:24:30 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.