Kevin Liew created PHOENIX-2424:
-----------------------------------
Summary: No error returned when upserting unsupported characters
into a varchar column
Key: PHOENIX-2424
URL: https://issues.apache.org/jira/browse/PHOENIX-2424
Project: Phoenix
Issue Type: Bug
Affects Versions: 4.5.2
Environment: Sending Avatica requests to Phoenix 4.5.2 using Telerik
Fiddler or any REST test tool
Reporter: Kevin Liew
Create a table with a character column (use the JDBC driver or bulk import tool)
{noformat}
DROP TABLE IF EXISTS SEN.WChar_Table;
CREATE TABLE IF NOT EXISTS SEN.WChar_Table(
KeyColumn VARCHAR(255) PRIMARY KEY,
Column1 CHAR(100));
{noformat}
Upsert an unsupported character using Avatica wire protocol
{noformat}
request: {
"request": "prepareAndExecute",
"connectionId": "1ccf2934-7b9b-491b-7d37-17be44bc811E",
"sql": "UPSERT INTO SEN.WVARCHAR_TABLE(KeyColumn, Column1)
VALUES('ConversionTestKey', '喂')",
"maxRowCount": -1
}
{noformat}
We expect an error (as occurs when attempting to upsert into a CHAR column) but
instead the upsert succeeds. So we query the inserted data and find that
incorrect data was inserted at results.firstFrame.rows\[0\]
{noformat}
{
"response": "Service$ExecuteResponse",
"results": [
{
"response": "resultSet",
"connectionId": "1ccf2934-7b9b-491b-7d37-17be44bc811E",
"statementId": 592785849,
"ownStatement": true,
"signature": {
"columns": [
{
"ordinal": 0,
"autoIncrement": false,
"caseSensitive": false,
"searchable": true,
"currency": false,
"nullable": 1,
"signed": false,
"displaySize": 510,
"label": "COLUMN1",
"columnName": "COLUMN1",
"schemaName": "",
"precision": 510,
"scale": 0,
"tableName": "SEN.WVARCHAR_TABLE",
"catalogName": "",
"type": {
"type": "scalar",
"id": 12,
"name": "VARCHAR",
"rep": "STRING"
},
"readOnly": true,
"writable": false,
"definitelyWritable": false,
"columnClassName": "java.lang.String"
}
],
"sql": null,
"parameters": [
],
"cursorFactory": {
"style": "LIST",
"clazz": null,
"fieldNames": null
}
},
"firstFrame": {
"offset": 0,
"done": true,
"rows": [
[
"å"
]
]
},
"updateCount": -1
}
]
}
{noformat}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)