List:General Discussion« Previous MessageNext Message »
From:Rick James Date:September 24 2012 5:03pm
Subject:RE: How to block SELECT * FROM table; but not SELECT * FROMT table
WHERE...;
View as plain text  
Even if you could block them, they would be easy to get around:
  SELECT * FROM tbl WHERE 1;

If you have long running queries, you should investigate the reasons (other than lack of
WHERE).

* MyISAM locks the table for any writes.  This prevents a SELECT from starting or a select
can prevent the INSERT/UPDATE/DELETE from starting.  Consider switching to InnoDB.

* How big is the table?  Why does the user want the whole table (if it is a plain SELECT
*)?  If you are doing Data Warehousing, consider summary tables.

Let's see the big picture; I expect there is a way to solve the _real_ problem, which I
guess is "performance".

> -----Original Message-----
> From: Arthur Fuller [mailto:fuller.artful@stripped]
> Sent: Sunday, September 23, 2012 3:39 PM
> To: Tim Pownall
> Cc: mysql@stripped
> Subject: Re: How to block SELECT * FROM table; but not SELECT * FROMT
> table WHERE...;
> 
> Tim,
> 
> I think you misunderstood the question. Daniel wants to block Select
> queries that ask for all rwows, and permit only queries that ask for
> some rows, as restricted by the Where clause.
> 
> Unfortunately, I don't think that can be done. But I'm not certain of
> that; there might be a trick.
> 
> Arthur
> www.artfulsoftware.com
> 
> On Sun, Sep 23, 2012 at 3:50 PM, Tim Pownall <pownalltim@stripped>
> wrote:
> 
> >  select * from table where column=value means it will return only
> rows
> > that match.  as long as you have proper indexing there should not be
> any issues.
> >
> > On Sun, Sep 23, 2012 at 1:23 PM, Luis Daniel Lucio Quiroz <
> > luis.daniel.lucio@stripped> wrote:
> >
> >
Thread
How to block SELECT * FROM table; but not SELECT * FROMT table WHERE...;Luis Daniel Lucio Quiroz23 Sep
  • Re: How to block SELECT * FROM table; but not SELECT * FROMT tableWHERE...;Reindl Harald23 Sep
  • Re: How to block SELECT * FROM table; but not SELECT * FROMT table WHERE...;Tim Pownall23 Sep
    • Re: How to block SELECT * FROM table; but not SELECT * FROMT tableWHERE...;Reindl Harald23 Sep
    • Re: How to block SELECT * FROM table; but not SELECT * FROMT table WHERE...;Arthur Fuller23 Sep
      • RE: How to block SELECT * FROM table; but not SELECT * FROMT tableWHERE...;Rick James24 Sep
RE: How to block SELECT * FROM table; but not SELECT * FROMT tableWHERE...;Martin Gainty23 Sep
  • RE: How to block SELECT * FROM table; but not SELECT * FROMT table WHERE...;abhishek jain24 Sep