Skip to content

Commit 417b221

Browse files
committed
Fix column type for MySQL 8.0. Fixes #1128
This information_schema column changed from INT to BIGINT between MySQL Server 5.7 and 8.0.
1 parent c22dd56 commit 417b221

File tree

2 files changed

+34
-2
lines changed

2 files changed

+34
-2
lines changed

src/MySqlConnector/Core/SchemaProvider.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -355,8 +355,8 @@ private async Task FillParameters(IOBehavior ioBehavior, DataTable dataTable, Ca
355355
new("PARAMETER_MODE", typeof(string)),
356356
new("PARAMETER_NAME", typeof(string)),
357357
new("DATA_TYPE", typeof(string)),
358-
new("CHARACTER_MAXIMUM_LENGTH", typeof(int)),
359-
new("CHARACTER_OCTET_LENGTH", typeof(int)),
358+
new("CHARACTER_MAXIMUM_LENGTH", typeof(long)),
359+
new("CHARACTER_OCTET_LENGTH", typeof(long)),
360360
new("NUMERIC_PRECISION", typeof(int)),
361361
new("NUMERIC_SCALE", typeof(int)),
362362
new("DATETIME_PRECISION", typeof(int)),

tests/SideBySide/SchemaProviderTests.cs

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,38 @@ void AssertHasColumn(string name, Type type)
7474
}
7575
}
7676

77+
[Theory]
78+
[InlineData("Databases")]
79+
[InlineData("DataTypes")]
80+
// only in 8.0 - [InlineData("KeyWords")]
81+
[InlineData("MetaDataCollections")]
82+
[InlineData("Procedures")]
83+
// only in 8.0 - [InlineData("ResourceGroups")]
84+
[InlineData("Tables")]
85+
[InlineData("Triggers")]
86+
[InlineData("Views")]
87+
#if !BASELINE
88+
[InlineData("CollationCharacterSetApplicability")]
89+
[InlineData("Engines")]
90+
[InlineData("KeyColumnUsage")]
91+
[InlineData("Parameters")]
92+
[InlineData("Partitions")]
93+
[InlineData("Plugins")]
94+
[InlineData("Profiling")]
95+
[InlineData("ProcessList")]
96+
[InlineData("ReferentialConstraints")]
97+
[InlineData("SchemaPrivileges")]
98+
[InlineData("TableConstraints")]
99+
[InlineData("TablePrivileges")]
100+
[InlineData("TableSpaces")]
101+
[InlineData("UserPrivileges")]
102+
#endif
103+
public void GetSchema(string schemaName)
104+
{
105+
var table = m_database.Connection.GetSchema(schemaName);
106+
Assert.NotNull(table);
107+
}
108+
77109
#if !BASELINE
78110
[Fact]
79111
public async Task GetMetaDataCollectionsSchemaAsync()

0 commit comments

Comments
 (0)