Bug #10326: Error while inserting cyrillic symbols into database
| From: | flying at dom dot natm dot ru | Date: | Sat, 14 Apr 2001 14:46:10 +0000 |
| Subject: | Bug #10326: Error while inserting cyrillic symbols into database | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-51576@lists.php.net to get a copy of this message | ||
From: flying@dom.natm.ru
Operating system: Windows NT4 SP6
PHP version: 4.0.4
PHP Bug Type: InterBase related
Bug description: Error while inserting cyrillic symbols into database
Environment:
Windows NT 4.0 SP6
PHP v4.0.4 (binaries from www.php.net)
InterBase v6.0.0.627
Apache v1.3.17
The following is metadata for simple InterBase database and short script that tries to insert a
range of symbols into this database.
All works ok while inserting symbols with codes lower than 128, but for all symbols with codes
greater than 128 (included cyrillic symbols in windows-1251 code page with codes in range 192..255)
the following error is received:
Warning: InterBase: arithmetic exception, numeric overflow, or string truncation Cannot
transliterate character between character sets in d:\web\dom\test\qqq.php on line 7
Note, that nothing is actually inserted into database. Executing the same query directly into
InterBase causes data to be inserted properly
Database metadata:
==================
SET SQL DIALECT 3;
SET NAMES WIN1251;
CREATE DATABASE 'D:\db\base.gdb' USER 'user' PASSWORD 'password'
PAGE_SIZE 4096
DEFAULT CHARACTER SET WIN1251;
CREATE GENERATOR GEN_TEST_ID;
SET GENERATOR GEN_TEST_ID TO 0;
CREATE TABLE TEST (
ID INTEGER NOT NULL,
TEXT VARCHAR(100));
SET TERM ^ ;
CREATE TRIGGER TEST_BI FOR TEST
ACTIVE BEFORE INSERT POSITION 0
AS
BEGIN
IF (NEW.ID IS NULL) THEN
NEW.ID = GEN_ID(GEN_TEST_ID,1);
END
^
SET TERM ; ^
Test PHP script to reproduce bug:
=================================
<?php
$ib = ibase_connect("d:\\db\\base.gdb" , "user", "password");
for ($i=60;$i<256;$i++)
{
$sql = "INSERT INTO TEST (TEXT) VALUES ('".chr($i)."');";
echo $sql."<br>";
$query = ibase_query($ib,$sql);
};
ibase_close($ib);
?>
--
Edit Bug report at: http://bugs.php.net/?id=10326&edit=1