Doubt about a select after creating a simple table in MariaDB 5.3.2
I was just testing MariaDB 5.3.2 and i created a simple table:
MariaDB [santus]> create table names (id int unsigned not null auto_increment, name varchar(32) unique, primary key(id));
MariaDB [santus]> desc names;
+------
| Field | Type | Null | Key | Default | Extra |
+------
| id | int(10) unsigned | NO | PRI | NULL | auto_increment |
| name | varchar(32) | YES | UNI | NULL | |
+------
2 rows in set (0.00 sec)
After this i just started to insert some records and find results where coming as if i done a sort by name asc
MariaDB [santus]> insert into names values ("", "santiago");
Query OK, 1 row affected, 1 warning (0.12 sec)
MariaDB [santus]> insert into names values ("", "Eugenia"), ("", "Maria");
Query OK, 2 rows affected, 2 warnings (0.11 sec)
Records: 2 Duplicates: 0 Warnings: 0
MariaDB [santus]> select * from names;
+----+----------+
| id | name |
+----+----------+
| 2 | Eugenia |
| 3 | Maria |
| 1 | santiago |
+----+----------+
3 rows in set (0.00 sec)
MariaDB [santus]> insert into names values ("", "Max"), ("", "Diego"), ("", "Scott");
Query OK, 3 rows affected, 3 warnings (0.38 sec)
Records: 3 Duplicates: 0 Warnings: 0
MariaDB [santus]> select * from names;
+----+----------+
| id | name |
+----+----------+
| 5 | Diego |
| 2 | Eugenia |
| 3 | Maria |
| 4 | Max |
| 1 | santiago |
| 6 | Scott |
+----+----------+
6 rows in set (0.00 sec)
MariaDB [santus]> select * from names order by id;
+----+----------+
| id | name |
+----+----------+
| 1 | santiago |
| 2 | Eugenia |
| 3 | Maria |
| 4 | Max |
| 5 | Diego |
| 6 | Scott |
+----+----------+
6 rows in set (0.00 sec)
So my normal selec * from names is tthe same as
MariaDB [santus]> select * from names order by name asc;
+----+----------+
| id | name |
+----+----------+
| 5 | Diego |
| 2 | Eugenia |
| 3 | Maria |
| 4 | Max |
| 1 | santiago |
| 6 | Scott |
+----+----------+
6 rows in set (0.00 sec)
Question information
- Language:
- English Edit question
- Status:
- Answered
- For:
- MariaDB Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Can you help with this problem?
Provide an answer of your own, or ask Santiago Lertora for more information if necessary.