Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

NpgsqlSchema: Use InvariantCulture on all return DataTables with schema ... #1

Merged
merged 1 commit into from Nov 19, 2012
Jump to file or symbol
Failed to load files and symbols.
+11 −0
Split
View
@@ -27,6 +27,7 @@
using System;
using System.Data;
+using System.Globalization;
using System.IO;
using System.Reflection;
using System.Text;
@@ -56,6 +57,7 @@ internal NpgsqlSchema(NpgsqlConnection connection)
internal static DataTable GetMetaDataCollections()
{
DataSet ds = new DataSet();
+ ds.Locale = CultureInfo.InvariantCulture;
using (Stream xmlStream = Assembly.GetExecutingAssembly().GetManifestResourceStream("Npgsql.NpgsqlMetaData.xml"))
{
ds.ReadXml(xmlStream);
@@ -70,6 +72,7 @@ internal static DataTable GetMetaDataCollections()
internal static DataTable GetRestrictions()
{
DataSet ds = new DataSet();
+ ds.Locale = CultureInfo.InvariantCulture;
using (Stream xmlStream = Assembly.GetExecutingAssembly().GetManifestResourceStream("Npgsql.NpgsqlMetaData.xml"))
{
ds.ReadXml(xmlStream);
@@ -129,6 +132,7 @@ private string RemoveSpecialChars(string paramName)
internal DataTable GetDatabases(string[] restrictions)
{
DataTable databases = new DataTable("Databases");
+ databases.Locale = CultureInfo.InvariantCulture;
databases.Columns.AddRange(
new DataColumn[] {new DataColumn("database_name"), new DataColumn("owner"), new DataColumn("encoding")});
@@ -157,6 +161,7 @@ internal DataTable GetDatabases(string[] restrictions)
internal DataTable GetTables(string[] restrictions)
{
DataTable tables = new DataTable("Tables");
+ tables.Locale = CultureInfo.InvariantCulture;
tables.Columns.AddRange(
new DataColumn[]
@@ -190,6 +195,7 @@ internal DataTable GetTables(string[] restrictions)
internal DataTable GetColumns(string[] restrictions)
{
DataTable columns = new DataTable("Columns");
+ columns.Locale = CultureInfo.InvariantCulture;
columns.Columns.AddRange(
new DataColumn[]
@@ -230,6 +236,7 @@ internal DataTable GetColumns(string[] restrictions)
internal DataTable GetViews(string[] restrictions)
{
DataTable views = new DataTable("Views");
+ views.Locale = CultureInfo.InvariantCulture;
views.Columns.AddRange(
new DataColumn[]
@@ -262,6 +269,7 @@ internal DataTable GetViews(string[] restrictions)
internal DataTable GetUsers(string[] restrictions)
{
DataTable users = new DataTable("Users");
+ users.Locale = CultureInfo.InvariantCulture;
users.Columns.AddRange(new DataColumn[] {new DataColumn("user_name"), new DataColumn("user_sysid", typeof (int))});
@@ -283,6 +291,7 @@ internal DataTable GetUsers(string[] restrictions)
internal DataTable GetIndexes(string[] restrictions)
{
DataTable indexes = new DataTable("Indexes");
+ indexes.Locale = CultureInfo.InvariantCulture;
indexes.Columns.AddRange(
new DataColumn[]
@@ -328,6 +337,7 @@ and pg_catalog.pg_table_is_visible(i.oid)
internal DataTable GetIndexColumns(string[] restrictions)
{
DataTable indexColumns = new DataTable("IndexColumns");
+ indexColumns.Locale = CultureInfo.InvariantCulture;
indexColumns.Columns.AddRange(
new DataColumn[]
@@ -418,6 +428,7 @@ internal static DataTable GetDataSourceInformation()
public static DataTable GetReservedWords()
{
DataTable table = new DataTable("ReservedWords");
+ table.Locale = CultureInfo.InvariantCulture;
table.Columns.Add("ReservedWord", typeof (string));
// List of keywords taken from PostgreSQL 9.0 reserved words documentation.
string[] keywords = new[]