Skip to content

Commit d7ebc4b

Browse files
committed
Add ReservedWords schema test. Fixes #559
1 parent 817b4e6 commit d7ebc4b

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed

docs/content/tutorials/migrating-from-connector-net.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ The following bugs in Connector/NET are fixed by switching to MySqlConnector. (~
127127
* [#89085](https://bugs.mysql.com/bug.php?id=89085): `MySqlConnection.Database` not updated after `USE database;`
128128
* [#89159](https://bugs.mysql.com/bug.php?id=89159): `MySqlDataReader` cannot outlive `MySqlCommand`
129129
* [#89335](https://bugs.mysql.com/bug.php?id=89335): `MySqlCommandBuilder.DeriveParameters` fails for `JSON` type
130+
* [#89639](https://bugs.mysql.com/bug.php?id=89639): `ReservedWords` schema contains incorrect data
130131
* [#91123](https://bugs.mysql.com/bug.php?id=91123): Database names are case-sensitive when calling a stored procedure
131132
* [#91199](https://bugs.mysql.com/bug.php?id=91199): Can't insert `MySqlDateTime` values
132133
* [#91751](https://bugs.mysql.com/bug.php?id=91751): `YEAR` column retrieved incorrectly with prepared command

src/MySqlConnector/Core/SchemaProvider.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public SchemaProvider(MySqlConnection connection)
1717
{ "MetaDataCollections", FillMetadataCollections },
1818
{ "DataTypes", FillDataTypes },
1919
{ "Procedures", FillProcedures },
20-
{ "ReservedWords", FillReservedWords }
20+
{ "ReservedWords", FillReservedWords },
2121
};
2222
}
2323

tests/SideBySide/QueryTests.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -965,6 +965,21 @@ public void HasRowsRepeated()
965965
}
966966
}
967967

968+
#if !NETCOREAPP1_1_2
969+
[Fact]
970+
public void ReservedWordsSchema()
971+
{
972+
var table = m_database.Connection.GetSchema("ReservedWords");
973+
Assert.NotNull(table);
974+
Assert.Single(table.Columns);
975+
Assert.Equal("ReservedWord", table.Columns[0].ColumnName);
976+
#if !BASELINE
977+
// https://bugs.mysql.com/bug.php?id=89639
978+
Assert.Contains("CREATE", table.Rows.Cast<DataRow>().Select(x => (string) x[0]));
979+
#endif
980+
}
981+
#endif
982+
968983
class BoolTest
969984
{
970985
public int Id { get; set; }

0 commit comments

Comments
 (0)