"Issues related to mismatched rows" in the MySQL database

Source: Internet
Author: User
Tags numeric numeric value

If you have a complex query that uses many tables but does not return any rows, you should use the following procedure to find out what went wrong:

Test the query with explain to see if something is clearly wrong.

Select only the columns that are used in the WHERE clause.

Deletes 1 tables 1 times from the query until some behavior is returned. If the table is large, a good idea is to use limit 10 in the query.

A select query is issued for a column that has a row that matches a table that was last deleted from the query.

If you compare a float or double column with a numeric value of a numeric type, you cannot use the equality (=) comparison. This problem is common in most computer languages because not all floating-point values are saved with accurate precision. In some cases, you can correct the problem by changing float to double. See the a.5.8 section, "issues related to floating-point comparisons."

If you still can't find the problem, create a minimal test that runs with MySQL test < Query.sql, which displays the issue. You can create a test file by using the mysqldump--quick db_name tbl_name_1 ... tbl_name_n > query.sql dump table. Open the file in the editor, delete some inserted rows (if there are rows that are required to exceed the presentation problem), and add a SELECT statement at the end of the file.

Verify that the test file can demonstrate the problem by executing the following command:

shell> mysqladmin create test2
shell> mysql test2 < query.sql

Use Mysqlbug to post the test file to the Yo na General MySQL mailing list.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.