You've already forked mariadb-columnstore-engine
							
							
				mirror of
				https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
				synced 2025-11-03 17:13:17 +03:00 
			
		
		
		
	Fix(MCOL-4607): SEC_TO_TIME(wideDecimal) returns 0 in DECIMAL context (#3474)
This commit is contained in:
		
							
								
								
									
										10
									
								
								mysql-test/columnstore/bugfixes/mcol_4607.result
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										10
									
								
								mysql-test/columnstore/bugfixes/mcol_4607.result
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,10 @@
 | 
				
			|||||||
 | 
					DROP DATABASE IF EXISTS mcol_4607;
 | 
				
			||||||
 | 
					CREATE DATABASE mcol_4607;
 | 
				
			||||||
 | 
					USE mcol_4607;
 | 
				
			||||||
 | 
					DROP TABLE IF EXISTS t1;
 | 
				
			||||||
 | 
					CREATE TABLE t1 (a DECIMAL(30,1)) ENGINE=ColumnStore;
 | 
				
			||||||
 | 
					INSERT INTO t1 VALUES (1);
 | 
				
			||||||
 | 
					SELECT SEC_TO_TIME(a), SEC_TO_TIME(a)+0.0 FROM t1;
 | 
				
			||||||
 | 
					SEC_TO_TIME(a)	SEC_TO_TIME(a)+0.0
 | 
				
			||||||
 | 
					00:00:01.0	1.0
 | 
				
			||||||
 | 
					DROP DATABASE mcol_4607;
 | 
				
			||||||
							
								
								
									
										15
									
								
								mysql-test/columnstore/bugfixes/mcol_4607.test
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								mysql-test/columnstore/bugfixes/mcol_4607.test
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,15 @@
 | 
				
			|||||||
 | 
					--source ../include/have_columnstore.inc
 | 
				
			||||||
 | 
					--disable_warnings
 | 
				
			||||||
 | 
					DROP DATABASE IF EXISTS mcol_4607;
 | 
				
			||||||
 | 
					--enable_warnings
 | 
				
			||||||
 | 
					CREATE DATABASE mcol_4607;
 | 
				
			||||||
 | 
					USE mcol_4607;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					--disable_warnings
 | 
				
			||||||
 | 
					DROP TABLE IF EXISTS t1;
 | 
				
			||||||
 | 
					--enable_warnings
 | 
				
			||||||
 | 
					CREATE TABLE t1 (a DECIMAL(30,1)) ENGINE=ColumnStore;
 | 
				
			||||||
 | 
					INSERT INTO t1 VALUES (1);
 | 
				
			||||||
 | 
					SELECT SEC_TO_TIME(a), SEC_TO_TIME(a)+0.0 FROM t1;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					DROP DATABASE mcol_4607;
 | 
				
			||||||
@@ -221,7 +221,7 @@ execplan::IDB_Decimal Func_sec_to_time::getDecimalVal(rowgroup::Row& row, Functi
 | 
				
			|||||||
    tmpVal = strtoll(str, &ep, 10);
 | 
					    tmpVal = strtoll(str, &ep, 10);
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if (parm[0]->data()->resultType().isWideDecimalType())
 | 
					  if (op_ct.isWideDecimalType())
 | 
				
			||||||
    d.s128Value = tmpVal;
 | 
					    d.s128Value = tmpVal;
 | 
				
			||||||
  else
 | 
					  else
 | 
				
			||||||
    d.value = tmpVal;
 | 
					    d.value = tmpVal;
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user