Bug #2807 A query without a WHERE clause don't work
Submitted: 15 Feb 2004 9:13 Modified: 10 Apr 2004 4:18
Reporter: Jean-Claude Colson Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Server: Command-line Clients Severity:S2 (Serious)
Version:4.1.1-alpha-standard OS:MacOS (Mac OS X 10.3.2)
Assigned to: CPU Architecture:Any

[15 Feb 2004 9:13] Jean-Claude Colson
Description:
I have a table with on record and I can't select all records without typing a where clause.
mysql> SELECT * FROM Test WHERE 1;
+--------+--------+-------------+
| Numéro | Latin1 | UTF8        |
+--------+--------+-------------+
|      1 | en été | en décembre |
+--------+--------+-------------+
1 row in set (0.00 sec)

mysql> SELECT * FROM Test;
ERROR 1096 (HY000): Aucune table utilisée

How to repeat:
mysql> SELECT * FROM Test;
ERROR 1096 (HY000): Aucune table utilisée
mysql> SHOW DATABASES;
ERROR: 
No query specified

mysql> 

Suggested fix:
mysql> SELECT * FROM Test;
+--------+--------+-------------+
| Numéro | Latin1 | UTF8        |
+--------+--------+-------------+
|      1 | en été | en décembre |
+--------+--------+-------------+
1 row in set (0.00 sec)

mysql>
[24 Feb 2004 11:05] MySQL Verification Team
Can't repeat with 4.1.2.

Can you upload your table here ??

I get this:

mysql> create table test (broj int(11), latin1 varchar(20) charset latin1, utf8 varchar(20) charset utf8 );
Query OK, 0 rows affected (0.00 sec)

mysql> insert into test values (1,"en ete", "en decembre");
Query OK, 1 row affected (0.00 sec)

mysql> select * from test;
+------+--------+-------------+
| broj | latin1 | utf8        |
+------+--------+-------------+
|    1 | en ete | en decembre |
+------+--------+-------------+
1 row in set (0.00 sec)
[10 Mar 2004 4:18] Jean-Claude Colson
(Note: all tables suffers of this bug (new tables, tables from database mysql and old tables (created with a other version of mysql)).
jc@eMac ~$ mysqldump Essai Test
-- MySQL dump 10.2
--
-- Host: localhost    Database: Essai
-- ------------------------------------------------------
-- Server version       4.1.1-alpha-standard

/*!40101 SET NAMES latin1*/;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE=NO_AUTO_VALUE_ON_ZERO */;

--
-- Table structure for table `Test`
--

DROP TABLE IF EXISTS Test;
CREATE TABLE Test (
  Numéro int(4) NOT NULL auto_increment,
  Latin1 text NOT NULL,
  UTF8 text character set utf8 NOT NULL,
  PRIMARY KEY  (Numéro)
) TYPE=MyISAM DEFAULT CHARSET=latin1;

--
-- Dumping data for table `Test`
--

/*!40000 ALTER TABLE Test DISABLE KEYS */;
LOCK TABLES Test WRITE;
INSERT INTO Test VALUES (1,'en été','en décembre');
UNLOCK TABLES;
/*!40000 ALTER TABLE Test ENABLE KEYS */;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;

jc@eMac ~$ mysql Essai
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 168 to server version: 4.1.1-alpha-standard

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> SELECT * FROM Test;
ERROR 1096 (HY000): Aucune table utilisée
mysql> SELECT * FROM Test WHERE 1;
+---------+----------+--------------+
| Numéro | Latin1   | UTF8         |
+---------+----------+--------------+
|       1 | en été | en décembre |
+---------+----------+--------------+
1 row in set (0.00 sec)

mysql>
[14 Feb 2005 22:54] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".