Fixed char columns returned unpadded by InfiniDB

Bug #461525 reported by mroberts
6
This bug affects 1 person
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,length(s_name) from supplier where s_suppkey<=10;
+--------------------+----------------+
| 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,length(s_name) from supplier where s_suppkey<=10;
+--------------------+----------------+
| 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,length(s_name) from supplier where s_suppkey<=10;

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.

mroberts (mroberts)
Changed in infinidb:
importance: Undecided → Low
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.