taosdata / TDengine

High-performance, scalable time-series database designed for Industrial IoT (IIoT) scenarios
https://tdengine.com
GNU Affero General Public License v3.0
23.33k stars 4.85k forks source link

整合springboot-mybatis后,批量插入入参不能带问号 ? #3648

Closed GK0505 closed 2 years ago

GK0505 commented 4 years ago

Bug Description Caused by: java.sql.SQLException: TDengine Error: syntax error near 'http://127.0.0.1:801/pic?=d11i052e*dcei055-69490b-086f0b1ed' (invalid data or symbol)

To Reproduce Steps to reproduce the behavior:

  1. 整合springboot-mybatis批量插入数据
  2. 一张表有两个url,每个url都有问号,mapper: INSERT INTO ${tableName} USING face TAGS (#{tenantId,jdbcType=VARCHAR}) VALUES ( #{item.shotTime,jdbcType=TIMESTAMP}, #{item.faceId,jdbcType=VARCHAR}, #{item.leftTopX,jdbcType=INTEGER}, #{item.leftTopY,jdbcType=INTEGER}, #{item.rightBtmX,jdbcType=INTEGER}, #{item.rightBtmY,jdbcType=INTEGER}, #{item.traitImg,jdbcType=VARCHAR}, #{item.sceneImg,jdbcType=VARCHAR} )

    traitImg,sceneImg为url,带问号 3.出差源码 TSDBPreparedStatement 118行 this.sql = this.sql.replaceFirst("[?]", "NULL");

Expected Behavior

Screenshots If applicable, add screenshots to help explain your problem. mybatis mapper image 初步判断出错的原因 image

Environment (please complete the following information):

Additional Context Add any other context about the problem here.

zyyang90 commented 4 years ago

请把问题写清楚一点,你这个是往tdengine里插入一个url,然后报错?你在Expected Behavior写的taos版本是2.0.3.1,在Environment写的TDengine版本是1.6.1.7

liangyuanpeng commented 3 years ago

可以尝试使用最新版本看是否还有这个问题

zyyang90 commented 2 years ago

This issue is stale because it has been open for 30 days with no activity.