Fixed char columns returned unpadded by InfiniDB
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
InfiniDB Community |
Confirmed
|
Low
|
Unassigned |
Bug Description
SQL-92 requires fixed-length columns (e.g. CHAR(25)) to be returned padded out
with spaces to the maximum length. InfiniDB (and MyISAM, even with sql_mode=ANSI)
does not do this:
s_name is CHAR(25)
CNX:
mysql> select s_name,
+------
| s_name | length(s_name) |
+------
| Supplier#000000001 | 18 |
| Supplier#000000002 | 18 |
| Supplier#000000003 | 18 |
| Supplier#000000004 | 18 |
| Supplier#000000005 | 18 |
| Supplier#000000006 | 18 |
| Supplier#000000007 | 18 |
| Supplier#000000008 | 18 |
| Supplier#000000009 | 18 |
| Supplier#000000010 | 18 |
+------
10 rows in set (0.07 sec)
MyISAM:
set sql_mode='ANSI';
mysql> select s_name,
+------
| s_name | length(s_name) |
+------
| Supplier#000000001 | 18 |
| Supplier#000000002 | 18 |
| Supplier#000000003 | 18 |
| Supplier#000000004 | 18 |
| Supplier#000000005 | 18 |
| Supplier#000000006 | 18 |
| Supplier#000000007 | 18 |
| Supplier#000000008 | 18 |
| Supplier#000000009 | 18 |
| Supplier#000000010 | 18 |
+------
10 rows in set (0.01 sec)
Oracle, however, appears to do the right thing:
SQL> select s_name,
S_NAME LENGTH(S_NAME)
-------
Supplier#000000001 25
Supplier#000000002 25
Supplier#000000003 25
Supplier#000000004 25
Supplier#000000005 25
Supplier#000000006 25
Supplier#000000007 25
Supplier#000000008 25
Supplier#000000009 25
Supplier#000000010 25
10 rows selected.
Changed in infinidb: | |
importance: | Undecided → Low |
status: | New → Confirmed |