mirror of
				https://github.com/MariaDB/server.git
				synced 2025-10-31 15:50:51 +03:00 
			
		
		
		
	FROM I_S Issue: ------ There is a difference in the field type created when the following DDLs are used: 1) CREATE TABLE t0 AS SELECT NULL; 2) CREATE TABLE t0 AS SELECT GREATEST(NULL,NULL); The first statement creates field of type Field_string and the second one creates a field of type Field_null. This creates a problem when the query mentioned in this bug is used. Since the null_ptr is calculated differently for Field_null. Solution: --------- When there is a function returning null in the select list as mentioned above, the field should be of type Field_string. This was fixed in 5.6+ as part of Bug#14021323. This is a backport to mysql-5.5. An incorrect comment in innodb_bug54044.test has been corrected in all versions.
		
			
				
	
	
		
			19 lines
		
	
	
		
			678 B
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			19 lines
		
	
	
		
			678 B
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
| CREATE TEMPORARY TABLE table_54044 ENGINE = INNODB
 | |
| AS SELECT IF(NULL  IS NOT NULL, NULL, NULL);
 | |
| SHOW CREATE TABLE table_54044;
 | |
| Table	Create Table
 | |
| table_54044	CREATE TEMPORARY TABLE `table_54044` (
 | |
|   `IF(NULL  IS NOT NULL, NULL, NULL)` binary(0) DEFAULT NULL
 | |
| ) ENGINE=InnoDB DEFAULT CHARSET=latin1
 | |
| DROP TABLE table_54044;
 | |
| CREATE TABLE tmp ENGINE = INNODB
 | |
| AS SELECT COALESCE(NULL, NULL, NULL), GREATEST(NULL, NULL), NULL;
 | |
| SHOW CREATE TABLE tmp;
 | |
| Table	Create Table
 | |
| tmp	CREATE TABLE `tmp` (
 | |
|   `COALESCE(NULL, NULL, NULL)` binary(0) DEFAULT NULL,
 | |
|   `GREATEST(NULL, NULL)` binary(0) DEFAULT NULL,
 | |
|   `NULL` binary(0) DEFAULT NULL
 | |
| ) ENGINE=InnoDB DEFAULT CHARSET=latin1
 | |
| DROP TABLE tmp;
 |