Bug #69451 redundant code in function row_import_for_mysql
Submitted: 12 Jun 2013 15:43 Modified: 12 Jun 2013 16:12
Reporter: zhai weixiang (OCA) Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S3 (Non-critical)
Version:5.6.12 OS:Any
Assigned to: CPU Architecture:Any

[12 Jun 2013 15:43] zhai weixiang
Description:
quoted code from row_import_for_mysql:

3698         if (err != DB_SUCCESS) {
3699                 return(row_import_error(prebuilt, trx, err));
3700         }
3701 
3702         if (err != DB_SUCCESS) {
3703                 return(row_import_error(prebuilt, trx, err));
3704         } else if (cfg.requires_purge(index->name)) {
3705 

so ,"err" was checked twice.

How to repeat:
read the code.

Suggested fix:
remove the redundant check
[12 Jun 2013 16:12] Umesh Shastry
Hello zhai,

Thank you for the report.
Verified as described.

//5.6

storage/innobase/row/row0import.cc:

 3697  
 3698  	if (err != DB_SUCCESS) {
 3699: 		return(row_import_error(prebuilt, trx, err));
 3700  	}
 3701  
 3702  	if (err != DB_SUCCESS) {
 3703: 		return(row_import_error(prebuilt, trx, err));
 3704  	} else if (cfg.requires_purge(index->name)) {
 3705  

Thanks,
Umesh