-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ORDER BY and LIMIT not working as expected #1257
Comments
Hi! that's weird, for sure. Can you tell me a couple things:
|
This looks like a node-pool issue 😕, anyway thanks for replying! |
@dougwilson I tried without node-pool and the same result. Here is the debug output: --> ComQueryPacket
ComQueryPacket {
command: 3,
sql: 'SELECT message, uid FROM messages WHERE id = \'1\' AND pool = \'0\' ORDER BY time DESC limit 0,15' }
<-- ResultSetHeaderPacket
ResultSetHeaderPacket { fieldCount: 2, extra: undefined }
<-- FieldPacket
FieldPacket {
catalog: 'def',
db: 'xat',
table: 'messages',
orgTable: 'messages',
name: 'message',
orgName: 'message',
charsetNr: 33,
length: 765,
type: 253,
flags: 4097,
decimals: 0,
default: undefined,
zeroFill: false,
protocol41: true }
<-- FieldPacket
FieldPacket {
catalog: 'def',
db: 'xat',
table: 'messages',
orgTable: 'messages',
name: 'uid',
orgName: 'uid',
charsetNr: 33,
length: 765,
type: 253,
flags: 4097,
decimals: 0,
default: undefined,
zeroFill: false,
protocol41: true }
<-- EofPacket
EofPacket {
fieldCount: 254,
warningCount: 0,
serverStatus: 34,
protocol41: true }
<-- RowDataPacket
RowDataPacket { message: 'the most recent msg', uid: '265826731' }
<-- RowDataPacket
RowDataPacket { message: 'test', uid: '265826731' }
<-- RowDataPacket
RowDataPacket { message: 'hello world!', uid: '265826731' }
<-- RowDataPacket
RowDataPacket { message: 'example', uid: '265826731' }
<-- RowDataPacket
RowDataPacket { message: '(smile)', uid: '265826731' }
<-- RowDataPacket
RowDataPacket { message: ' (swt) (swt) (swt) (swt) ', uid: '265826731' }
<-- RowDataPacket
RowDataPacket { message: ' (astonished) ', uid: '265826731' }
<-- RowDataPacket
RowDataPacket { message: 'helloooo', uid: '265826731' }
<-- RowDataPacket
RowDataPacket { message: 'blabla', uid: '265826731' }
<-- RowDataPacket
RowDataPacket { message: 'message', uid: '265826731' }
<-- RowDataPacket
RowDataPacket { message: 'another msg', uid: '265826731' }
<-- RowDataPacket
RowDataPacket { message: 'hello world', uid: '265826731' }
<-- RowDataPacket
RowDataPacket { message: 'my message', uid: '265826731' }
<-- RowDataPacket
RowDataPacket { message: 'example', uid: '265826731' }
<-- RowDataPacket
RowDataPacket { message: 'hello', uid: '265826731' }
<-- EofPacket
EofPacket {
fieldCount: 254,
warningCount: 0,
serverStatus: 34,
protocol41: true } |
Hi, I don't know any more how to follow this conversation, because the only right/wrong things I have to go on is your original post, which is only about two rows, but suddenly you switched to a bunch of rows. Are those data packets in the order you expected? Is the raw array you get from the We should be presenting you the I'm not sure how to help further, because I'm no longer sure what the exact bug report is :/ |
Wait a minute, I just realized: your original post makes no sense. From your screenshot of your rows, you have basically the following:
Then your query against that has Your then show that this is how, indeed, you are getting the results. You went on to say you expected them in the reverse order. If this is the last, you want ascending order, or |
Steps to reproduce
SELECT message, uid FROM messages WHERE id = '#{roomId}' AND pool = '#{@chat.onPool}' ORDER BY time DESC limit 0,15
Issue
The expected result must be:
but I get:
The text was updated successfully, but these errors were encountered: