[Original] MySQL's improvement in reading abnormal and Error Buffer (MySQL5.6)

Source: Internet
Author: User
What is an error buffer? In MySQL, the Error Buffer only records the last error. If a new error is generated, the old one will be overwritten. So if you want to know what errors are generated, you have

What is an error buffer? In MySQL, the Error Buffer only records the last error. If a new error is generated, the old one will be overwritten. So if you want to know what errors are generated, you have

What is an error buffer?

In MySQL, the Error Buffer only records the last error. If a new error is generated, the old one will be overwritten. So I want to know what the error is,

You must follow the "show warnings" or "show errors" statements that may cause errors ". The simplest way is to redirect the output result to the custom one.

Log File to facilitate subsequent viewing. If you want to view these errors at any time, you must use the APIS provided by MySQL.

Since the emergence of the revolutionary MySQL 5.6 version, the problem has been preliminarily solved. Although it is far from what we think.

MySQL 5.6 provides the get diagnostic statement to get the content of the Error Buffer, and then output the content to variables in different range fields, so that we can flexibly perform subsequent operations.

Next, let's look at an example.

The target table structure is:

The Stored Procedure Code is:

Let's execute the above stored procedure. After the server space is complete, the website space will save the error information to the SESSION variable @ I _result. In this way, the Hong Kong Space facilitates subsequent output.

This article is from "god, let's see it !" Blog, please keep this source

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.