You are viewing fallenpegasus

entries friends calendar profile My Website Previous Previous Next Next
Mark Atwood - Thoughts while reviewing MySQL documention
fallenpegasus
fallenpegasus
Add to Memories
Share
Thoughts while reviewing MySQL documention
Why may LIMIT only take a fixed number? Not even a user variable, let alone an expression.

Wouldn't it be useful to set a user session variable that always gets applied as an implicit limit value?

Both of these things could be done in Drizzle.

Tags: ,

Comments
elfs From: elfs Date: July 31st, 2008 07:59 pm (UTC) (Link)
That's why they pay you the big bucks.
From: harrison_fisk Date: July 31st, 2008 08:39 pm (UTC) (Link)
SQL_SELECT_LIMIT automatically limits results for every query on a session.

SET SQL_SELECT_LIMIT = 1;
SELECT * FROM test.tbl;
supersnazz From: supersnazz Date: July 31st, 2008 08:42 pm (UTC) (Link)
That doesn't account for two-part LIMIT clauses, which is to say those with both a limit and an offset.
From: harrison_fisk Date: July 31st, 2008 08:49 pm (UTC) (Link)
Why would one want to use a session based offset/limit? I can see a definite use case for limiting all of the time, but not sure why one would want to always use an offset.
fallenpegasus From: fallenpegasus Date: August 2nd, 2008 12:40 am (UTC) (Link)
Cool, I did not know that.

Sometime I need to sit down and just read all the system variables.
5 comments or Leave a comment
profile
Mark Atwood
Name: Mark Atwood
Website: My Website
calendar
Back May 2014
123
45678910
11121314151617
18192021222324
25262728293031
page summary
tags