Troubleshooting of MySQLJOIN operation errors

Source: Internet
Author: User
The above adjustments can basically solve most of these problems, but our stored procedures still cannot be executed. After some analysis, we found that a temporary table will be created during the stored procedure. The code is like this: INSERTINTOtmp (region, cell, relation) SELECTDISTINCTr. region, t. cell,-1FROMrr_tmprLEFTJOIN (

The above adjustments can basically solve most of these problems, but our stored procedures still cannot be executed. After some analysis, we found that a temporary table will be created during the stored procedure. The code is like this: insert into tmp (region, cell, relation) select distinct r. region, t. cell,-1 FROM rr_tmp r left join (

The above adjustments can basically solve most of these problems, but our stored procedures still cannot be executed. After some analysis, we found that a temporary table will be created during the stored procedure. The code is like this:

INSERT INTO tmp(region, cell, relation)SELECT DISTINCT r.region, t.cell, -1FROM rr_tmp r LEFT JOIN ( SELECT DISTINCT region, cell FROM ri_tmp ri, ce_tmp ct WHERE ri.region=ce.region) tON r.region=t.region WHERE r.region is null;

We suspect that the character encoding is inconsistent because the character encoding of the temporary table is inconsistent with that of the rr_tmp table. But how can we control the character encoding of the temporary table?

The character encoding of a temporary table is actually the default character encoding of the database.show create database test_dbWe can see that the character encoding of the database is changed to be the same as that of rr_tmp.

alter database test_db characeter set utf8

Date: 2015-02-04T15: 58 + 0800

Author: CobbLiu

Org version 7.9.3f with Emacs version 24

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.