Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

Programmer here, be gentle.

I'm working in a MySQL database with only a single table, as shown by show tables:

mysql> show tables;
+----------------------+
| Tables_in_widget_web |
+----------------------+
| widget_signups       |
+----------------------+
1 row in set (0.00 sec)

At some point earlier in development there might have been other tables as well, but for what we were doing we decided that we were probably over-architecting and nixed them.

I noticed the other day that auto-complete within mysql was not working properly in this database. When I am using the particular database and I type SELECT * FROM widget<TAB> I wasn't getting my good old auto-complete that I was used to. Double tabbing to see possible auto-completions yields:

mysql> SELECT * FROM widget<TAB><TAB>
widget_date
widget_signups
[... columns on widget_signups ...]

Yet when I try to DROP this mysterious and previously deleted widget_date table, I predictably get errors saying the table doesn't exist.

My question is this: how can I repair my beloved mysql auto-complete by removing this phantom table? I would assume (wrongly?) that auto-complete suggestions within the mysql command line are drawn from a table within mysql. Where can I go to zap this safely - or do I just need to man up and get used to typing the entire table name?

share|improve this question
    
Is widget_date the name of one of your table columns, perchance? –  Phil Jan 16 '13 at 15:39
    
It is, but it shows up in the omitted portions [... columns on widget_signups ...] as widget_signup.widget_date –  chucksmash Jan 16 '13 at 15:42
    
Thought as much. The auto-complete isn't context aware, thus causing the issue that's distressing you :) –  Phil Jan 16 '13 at 15:44
    
Ahhhhhhh. That makes perfect sense. Make it an answer? –  chucksmash Jan 16 '13 at 15:45
add comment

1 Answer

up vote 3 down vote accepted

This is happening because the auto-complete isn't context aware & it's offering you a column name of widget_date as well as the table name you're expecting.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.