Skip to content

Commit

Permalink
Remove TABLESPACES schema. Fixes #1477
Browse files Browse the repository at this point in the history
Signed-off-by: Bradley Grainger <[email protected]>
  • Loading branch information
bgrainger committed Oct 5, 2024
1 parent e93cbf3 commit 6010787
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 49 deletions.
3 changes: 1 addition & 2 deletions docs/content/overview/schema-collections.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
lastmod: 2023-12-15
date: 2021-04-24
lastmod: 2024-10-05
title: Schema Collections
customtitle: "Supported Schema Collections"
description: Information about the schemas supported by MySqlConnection.GetSchema.
Expand Down Expand Up @@ -41,7 +41,6 @@ weight: 80
* `Tables`[information about tables](../schema/tables/)
* `TableConstraints`
* `TablePrivileges`
* `TableSpaces`
* `Triggers`
* `UserPrivileges`
* `Views`
Expand Down
25 changes: 0 additions & 25 deletions src/MySqlConnector/Core/SchemaProvider.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,6 @@ public async ValueTask<DataTable> GetSchemaAsync(IOBehavior ioBehavior, string c
await FillTableConstraintsAsync(ioBehavior, dataTable, "TableConstraints", restrictionValues, cancellationToken).ConfigureAwait(false);
else if (string.Equals(collectionName, "TablePrivileges", StringComparison.OrdinalIgnoreCase))
await FillTablePrivilegesAsync(ioBehavior, dataTable, "TablePrivileges", restrictionValues, cancellationToken).ConfigureAwait(false);
else if (string.Equals(collectionName, "TableSpaces", StringComparison.OrdinalIgnoreCase))
await FillTableSpacesAsync(ioBehavior, dataTable, "TableSpaces", restrictionValues, cancellationToken).ConfigureAwait(false);
else if (string.Equals(collectionName, "Triggers", StringComparison.OrdinalIgnoreCase))
await FillTriggersAsync(ioBehavior, dataTable, "Triggers", restrictionValues, cancellationToken).ConfigureAwait(false);
else if (string.Equals(collectionName, "UserPrivileges", StringComparison.OrdinalIgnoreCase))
Expand Down Expand Up @@ -125,7 +123,6 @@ private Task FillMetaDataCollectionsAsync(IOBehavior ioBehavior, DataTable dataT
dataTable.Rows.Add("Tables", 4, 3);
dataTable.Rows.Add("TableConstraints", 0, 3);
dataTable.Rows.Add("TablePrivileges", 0, 0);
dataTable.Rows.Add("TableSpaces", 0, 0);
dataTable.Rows.Add("Triggers", 0, 3);
dataTable.Rows.Add("UserPrivileges", 0, 0);
dataTable.Rows.Add("Views", 0, 3);
Expand Down Expand Up @@ -757,28 +754,6 @@ private async Task FillTablePrivilegesAsync(IOBehavior ioBehavior, DataTable dat
await FillDataTableAsync(ioBehavior, dataTable, "TABLE_PRIVILEGES", null, cancellationToken).ConfigureAwait(false);
}

private async Task FillTableSpacesAsync(IOBehavior ioBehavior, DataTable dataTable, string tableName, string?[]? restrictionValues, CancellationToken cancellationToken)
{
if (restrictionValues is not null && restrictionValues.Length > 0)
throw new ArgumentException("restrictionValues is not supported for schema 'TableSpaces'.", nameof(restrictionValues));

dataTable.TableName = tableName;
dataTable.Columns.AddRange(
[
new("TABLESPACE_NAME", typeof(string)),
new("ENGINE", typeof(string)),
new("TABLESPACE_TYPE", typeof(string)),
new("LOGFILE_GROUP_NAME", typeof(string)),
new("EXTENT_SIZE", typeof(long)),
new("AUTOEXTEND_SIZE", typeof(long)),
new("MAXIMUM_SIZE", typeof(long)),
new("NODEGROUP_ID", typeof(long)),
new("TABLESPACE_COMMENT", typeof(string)),
]);

await FillDataTableAsync(ioBehavior, dataTable, "TABLESPACES", null, cancellationToken).ConfigureAwait(false);
}

private async Task FillTriggersAsync(IOBehavior ioBehavior, DataTable dataTable, string tableName, string?[]? restrictionValues, CancellationToken cancellationToken)
{
if (restrictionValues is not null && restrictionValues.Length > 0)
Expand Down
22 changes: 0 additions & 22 deletions tools/SchemaCollectionGenerator/SchemaCollections.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -652,28 +652,6 @@
- name: IS_GRANTABLE
type: string

- name: TableSpaces
table: TABLESPACES
columns:
- name: TABLESPACE_NAME
type: string
- name: ENGINE
type: string
- name: TABLESPACE_TYPE
type: string
- name: LOGFILE_GROUP_NAME
type: string
- name: EXTENT_SIZE
type: long
- name: AUTOEXTEND_SIZE
type: long
- name: MAXIMUM_SIZE
type: long
- name: NODEGROUP_ID
type: long
- name: TABLESPACE_COMMENT
type: string

- name: Triggers
table: TRIGGERS
identifierPartCount: 3
Expand Down

0 comments on commit 6010787

Please sign in to comment.