Inserting data in table with umlaut is not possible

萝らか妹 提交于 2020-01-05 05:51:34

问题


I am using Cassandra 1.2.5 (cqlsh 3.0.2) and trying to inserting data in a small test-database with german characters which is not possible. I get back the message from cqlsh: "Bad Request: Input length = 1"

below is the setup of the keyspace, the table and the insert.

CREATE KEYSPACE test  WITH REPLICATION = { 'class' : 'SimpleStrategy', 'replication_factor' : 1 };
use test;

CREATE TABLE testdata (
id varchar,
text varchar,
PRIMARY KEY (id)

This is working:

insert into testdata (id, text) values ('4711', 'test');

This is not allowed:

insert into testdata (id, text) values ('4711', 'töst`);

->Bad Request: Input length = 1

my locale is :de_DE.UTF-8

Does Cassandra 1.2.5 has a problem with Umlaut ?


回答1:


I just did what you posted and it worked for me. The one thing that was different however, is that instead of a single quote, you finished 'töst` with a backtick. That doesn't allow me to finish the statement in cqlsh. When I replace that with 'töst' it succeeds and I get:

cqlsh:test> select * from testdata;

 id   | text
------+------
 4711 | töst


来源:https://stackoverflow.com/questions/17425262/inserting-data-in-table-with-umlaut-is-not-possible

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!