MySQL ver 5.1.26
I'm getting the wrong result with that selection, Order and limit section This is only a problem when using the ID column.
I have seen manually for Mysore
My guess is by reading the manual that there is some problem in index, primary key ID, but I do not know where I should go from here ...
Q: What should I do to get the best solution to the problem?
works correctly: mysql & gt; ID ORDER ID created by SELECT id, billing_invoices, WHERE (billing_invoices.account_id = 5); by DESC; + ------ + --------------------- + | ID | Made_at | + ------ + --------------------- + | 1336 | 2010-05-14 08:05:25 | | 1334 | 2010-05-06 08:05:25 | | 1331 | 2010-05-05 23:18:11 | + ------ + --------------------- + 3 rows set (0.00 seconds) False result when the limit was added! The first line should be, id - 1336 mysql & gt; Order created from SELECT id, billing_invoices, WHERE (billing_ invoices.account_id = 5); Order by IDEEC Limit 1; + ------ + --------------------- + | ID | Made_at | + ------ + --------------------- + | 1331 | 2010-05-05 23:18:11 | + ------ + --------------------- Rows (0.00 seconds) in 1 set work correctly: mysql & gt; SELECT id, created from WHERE from billing_invenises (billing_invices.account_id = 5) ordered by DASC; + ------ + --------------------- + | ID | Made_at | + ------ + --------------------- + | 1336 | 2010-05-14 08:05:25 | | 1334 | 2010-05-06 08:05:25 | | 1331 | 2010-05-05 23:18:11 | + ------ + --------------------- + 3 lines set (0.01 seconds) works correctly with range: mysql & gt ; SELECT id, created by WHERE from billing_invoices_mat (billing_invices.account_id = 5) DACCC limit created by ORDER; + ------ + --------------------- + | ID | Made_at | + ------ + --------------------- + | 1336 | 2010-05-14 08:05:25 | + ------ + --------------------- Row (0.01 seconds) in + 1 set Additional information: Understand SELECT id, Created from Billing_Invenues_only WHERE (billing_invices.count_id = 5) order by ID DESC limit 1; + ---- + ------------- + ------------------ + ------- + --- ----------------------------------- + -------------- ------------------------ + --------- + ------ + ------ + - ------------ + | ID | Select_type | Table | Type | Possible_Keys | Key | Key_len | Referee | Rows | Extra | + ---- + ------------- + ------------------ + ------- + --- ----------------------------------- + -------------- ------------------------ + --------- + ------ + ------ + - ------------ + | 1 | Simple | Billing_invoice | Category | Index_billing_invoices_on_account_id | Index_billing_invoices_on_account_id | 4 | Faucet 3 | Where to use + ---- + ------------- + ------------------ + ------- + --- ----------------------------------- + -------------- ------------------------ + --------- + ------ + ------ + - ------------ +
Table billing_invoices added to create result:
table - create billing_voices table - create Tab 'billing_voice' (`id`bit (11) no tap autacaccrantment, 'account_id' at (11), not the date of 'invoice_date', 'eGRIIOCOCIIDIT' (11) default faucet,` close_billan` decimal (8, 2) No tap, `note 'varchar (255) COLLATE utf8_unicode_ci defaulge `` Created_at`` date default default, 'updated_at', 'datetime default faucet' of primary (`id`), key` index_billing_invoice_on_account_id` (`account_id`)) engine = indoebay outengment = 1337 Default Charset = UTF8 Calllet = UTF 8_Incode_C
Added more:
Now see my development machine, everything is working properly. 5.1.26-RC-Law in
The version on my production machine, where is the problem, I think VERSION () 5.1.26-Rc-percona-log
then this At the point, I'm thinking the problem is with Percona software?
Added more:
At this point, I'm going to consider it a bug in the Percona Innodb Driver. I have put one as an immediate job, I'm going to order by created_at I also check to upgrade DB in my system and see if it helps.
Thank you for helping Rabboot and MDMA. I also appreciate the help that I am not doing anything silly, it is actually a problem.
Is this bug ever resolved for your updated version?
I am running 5.1.42 locally. I am copying and pasting your questions above and getting all the right results .. Is it a bug mentioned above or not, it seems like a bug, and it was decided in a recent release compared to you ..
Comments
Post a Comment