Hi Nirbhay,
when we fall into a situation where valid use cases contradicting
to each other, usually that means we're doing something wrong.
Even so, I'd say following use case #4 is less important than
following use case #8. After all, I think, our major use case
is filtering dump provided by mysqldump.
Regards,
Sergey
On Wed, Nov 24, 2010 at 12:40:30PM +0530, Nirbhay Choubey wrote:
> Hi Sergey,
>
> This, IMO, is again expected. See below.
>
> On Tuesday 23 November 2010 11:50 PM, Sergey Vojtovich wrote:
> >Hi Nirbhay,
> >
> >use case #8:
> >I have a dump provided by mysqldump tool:
> >--
> > USE `test`;
> > CREATE TABLE `table_in_test`(a INT);
> > USE `non_existent_db`;
> > CREATE TABLE `table_in_non_existent_db`(a INT);
> >--
> >Note: I simplified dump for better readability.
> >
> >I have no `non_existent_db` database.
> >I have empty `test` database.
> >I do "mysql --one-database test".
> >I expect no `table_in_non_existent_db` in `test`.
> >Without this patch I get no `table_in_non_existent_db` in `test`.
> >With this patch I get `table_in_non_existent_db` in `test`.
>
> This case looks pretty much similar to case #4 that we already discussed.
>
> <cut>
> I run "mysql" with one-database option.
> I specify "test" as database name.
> I execute USE non-existent-db.
> I get "ERROR 1049 (42000): Unknown database 'non-existent-db'".
> I execute "\R \d> ".
> I get "test> ".
> I expect "test> " (actually I would expect 'non-existent-db').
> I execute SELECT 1.
> I get "Ignoring query to other database".
> I expect "1" (actually I would expect 'Ignoring query to other database').
> </cut>
>
> I have already pushed a fix for this, i.e the last statement will no
> more be filtered
> as current_db is same as test. (And SELECT 1 will no longer be filtered out)
>
> On the similar lines, in use case #8 :
>
> mysql> \R \d >
> test > use test;
> test >create table tab_in_test(i int);
> test >use non_existent_db;
> ERROR 1049 (42000): Unknown database 'non_existent_db'
> test >create table tab_in_non_existent_db(i int);
> # Since current_db/prompt still says 'test', statement is not
> filtered.
> test >show tables in test;
> tab_in_non_existent_db
> tab_in_test
>
> So, both the cases #4 and #8 contradict each other, i.e.
> in one case we are saying, SELECT 1 should not be filtered,
> while in the other we say 'CREATE TABLE' should be.
>
> Best Regards,
> Nirbhay
>
> >Regards,
> >Sergey
> >
> ,
>
> --
> MySQL Code Commits Mailing List
> For list archives: http://lists.mysql.com/commits
> To unsubscribe: http://lists.mysql.com/commits?unsub=1
>
--
Sergey Vojtovich <svoj@stripped>
MySQL AB, Software Engineer
Izhevsk, Russia, www.mysql.com