Fix a crash bug when the locale isn't set.
authorHiroshi Inoue <h-inoue@dream.email.ne.jp>
Thu, 27 Apr 2017 11:56:18 +0000 (20:56 +0900)
committerHiroshi Inoue <h-inoue@dream.email.ne.jp>
Thu, 27 Apr 2017 11:56:18 +0000 (20:56 +0900)
connection.c

index 9bf403d7f8b283fc4ec246ae28c4f2ad2c3c207b..a78428b4e72ce4682a0c600d227f980f39bf6d84 100644 (file)
@@ -597,8 +597,9 @@ CC_determine_locale_encoding(ConnectionClass *self)
    if (self->locale_encoding) /* already set */
                 return;
    encoding = derive_locale_encoding(dbencoding);
-   if (encoding)
-       CC_set_locale_encoding(self, encoding);
+   if (!encoding)
+       encoding = "SQL_ASCII";
+   CC_set_locale_encoding(self, encoding);
 }
 
 static void