manchiang / assql

Automatically exported from code.google.com/p/assql
0 stars 2 forks source link

Error in inserting/updating cyrillic data #101

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
assql v. Beta2.8, mysql v. 5.1.45

Here is my modification of simple example:

private function onCreationComplete():void {
con = new Connection("localhost", 3306, "root", "1", "neoantey");
con.addEventListener(Event.CONNECT, handleConnected);
con.connect();
}

private function handleConnected(e:Event):void {
var st:Statement = con.createStatement();

var token:MySqlToken = st.executeQuery("INSERT INTO `autos` (mark) values 
('заз')");

token.addResponder(new AsyncResponder(
function(data:Object, token:Object):void {

                    },

function(info:Object, token:Object):void {
Alert.show("Error: " + info);
},

token
));
}

and in result we have:
Error: SQL Error #22021: Incorrect string value: 
'\xD0\xB7\xD0\xB0\xD0\xB7...' for column 'mark' at row 1

Original issue reported on code.google.com by 40mi...@gmail.com on 25 Apr 2010 at 10:45

GoogleCodeExporter commented 9 years ago
Im using pure as3.
And russian text inserted fine to me

function insertRussian():void{

    var statement:Statement = con.createStatement();
            statement.sql = "INSERT INTO test (id,name) VALUES (?,?)";
            statement.setNumber(1, 1);
            statement.setString(2, "русский");

            var token:MySqlToken = statement.executeQuery();
            token.addEventListener(MySqlErrorEvent.SQL_ERROR, onError);
            token.addEventListener(MySqlEvent.RESPONSE, onSqlResponse);
        }

        private function onSqlResponse(e:MySqlEvent):void {

        }

        private function onSqlError(e:MySqlErrorEvent):void {

        }

Original comment by terboo...@gmail.com on 9 Jun 2010 at 9:46