Skip to content
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

load data incorrect with default fields terminate when tab's space exists in file #1250

Closed
yexiaoli88 opened this issue Jul 1, 2019 · 2 comments
Assignees
Labels
load-data Priority/High expect fix as quickly as possible resolve problem has been fixed by developer
Milestone

Comments

@yexiaoli88
Copy link

yexiaoli88 commented Jul 1, 2019

  • **dble version:5.6.29-dble-9.9.9.9-16ae8083a9edeb67ab102cded51446e27d7ee2f5-20190628070902 **
  • preconditions :
CREATE TABLE sharding_four(ID INT NOT NULL,FirstName VARCHAR(20),LastName VARCHAR(20),Department VARCHAR(20),Salary INT);

2.test.txt with tab:

201     "Mazojys        ddd     ggg"    "Fxoj"  "Finance"       7800

3.turn on backend mysql 's general log

  • configs:

schema.xml

<schema name="testdb" sqlMaxLimit="100" dataNode="dn4">
       <table name="sharding_four" dataNode="dn1,dn2,dn3,dn4" rule="hash-four"/>
    </schema>

rule.xml

<tableRule name="hash-four">
        <rule>
            <columns>id</columns>
            <algorithm>four-long</algorithm>
        </rule>
  </tableRule>
 <function name="four-long" class="Hash">
        <property name="partitionCount">4</property>
        <property name="partitionLength">1</property>
    </function>
  • steps:
    1.execute follows in dble:
mysql> load data infile "/opt/test.txt" into table sharding_four  FIELDS   OPTIONALLY ENCLOSED BY '"'   LINES TERMINATED BY '\n';
Query OK, 1 row affected (0.00 sec)
Records: 1  Deleted: 0  Skipped: 0  Warnings: 0
  1. verify if load data works fine
mysql> select * from sharding_four;
+-----+-----------+----------+------------+--------+
| ID  | FirstName | LastName | Department | Salary |
+-----+-----------+----------+------------+--------+
| 201 | Mazojys  | ddd      | ggg       |      0 |
+-----+-----------+----------+------------+--------+
2 rows in set (0.00 sec)

  1. find out sql executed in mysql from general log:
2019-07-30T10:14:38.028049Z	 1001 Query		LOAD DATA LOCAL INFILE '/opt/test.txt' INTO TABLE sharding_four COLUMNS OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '
'
  1. execute the same load data sql in mysql:
mysql> load data infile "/opt/test.txt" into table sharding_four FIELDS   OPTIONALLY ENCLOSED BY '"'  LINES TERMINATED BY '\n';
Query OK, 1 row affected (0.00 sec)
Records: 1  Deleted: 0  Skipped: 0  Warnings: 0

mysql> select * from sharding_four;
+-----+-----------------+----------+------------+--------+
| ID  | FirstName       | LastName | Department | Salary |
+-----+-----------------+----------+------------+--------+
| 201 | Mazojys	ddd	ggg | Fxoj     | Finance    |   7800 |
+-----+-----------------+----------+------------+--------+
1 row in set (0.00 sec)
  • expect result:
    1..the second column in step2 should be ' Mazojys ddd ggg' ,the same as it in step4

  • real result:
    1.the second column in step2 is ' "Mazojys '

  • supplements:

@yanhuqing666 yanhuqing666 added this to the 2.19.07.0 milestone Jul 4, 2019
@yanhuqing666 yanhuqing666 added load-data Priority/High expect fix as quickly as possible labels Jul 4, 2019
@yexiaoli88
Copy link
Author

related #1248

@PanternBao PanternBao added the resolve problem has been fixed by developer label Aug 2, 2019
@PanternBao PanternBao assigned wjl1619 and unassigned PanternBao Aug 2, 2019
@wjl1619
Copy link
Member

wjl1619 commented Aug 2, 2019

verified on version: 5.6.29-dble-9.9.9.9-e2603d1945eec66ed3fd11f2608027ab324ca483-20190802031757

@wjl1619 wjl1619 closed this as completed Aug 2, 2019
yanhuqing666 pushed a commit that referenced this issue Dec 16, 2019
yanhuqing666 pushed a commit that referenced this issue Dec 16, 2019
yanhuqing666 pushed a commit that referenced this issue Dec 16, 2019
yanhuqing666 pushed a commit that referenced this issue Dec 20, 2019
yanhuqing666 pushed a commit that referenced this issue Dec 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
load-data Priority/High expect fix as quickly as possible resolve problem has been fixed by developer
Projects
None yet
Development

No branches or pull requests

4 participants