MSSQL stored procedures does not correctly works with schemas
まだ誰も着手していません。
評価
調査の方向性
まず、提供された MSSQL スキーマおよびストアドプロシージャのスクリプトを実行し、その後 SqlDataProvider.GetDataContext と ctx.Procedures を通じて問題を再現します。clm と eeInf にある同名のプロシージャがどのように検出され、公開されるかを追跡します。両方のスキーマ固有のプロシージャが区別されたままになり、Invoke がそれぞれに正しいパラメーターを表示すれば完了です。
索引モデルが issue の本文から書いたものです。
説明
SqlDataProvider does not have the functionality to specify schema of stored procedure (in contrast to accessing the tables). Rather, all stored procedures appear under ctx.Procedures where ctx is a database context obtained via call to GetDataContext, e.g.:
type private WorkerNodeDb = SqlDataProvider<
Common.DatabaseProviderTypes.MSSQLSERVER,
ConnectionString = WorkerNodeConnectionStringValue,
UseOptionTypes = Common.NullableColumnType.OPTION>
type private WorkerNodeDbContext = WorkerNodeDb.dataContext
let private getDbContext (c : unit -> ConnectionString) = c().value |> WorkerNodeDb.GetDataContext
This how clm.tryUpdateProgressRunQueue (from schema clm) appears in F#:

Hovering over (as shown on the picture) correctly shows that the stored procedure belongs to clm schema. This is inconvenient but that would've been OK and that could be dealt with.
However, the error appears if there is a stored procedure with the same name but in a different schema (eeInf in the example). The second procedure "acquires" an extra ' in the name:

Unfortunately, finally nothing works. Hovering over Invoke shows SP parameters mixed up from both procedures:

Here are the blank SPs along with schema creation scripts for convenience:
if not exists(select schema_name from information_schema.schemata where schema_name = 'clm') begin
print 'Creating schema clm...'
exec sp_executesql N'create schema clm'
end else begin
print 'Schema clm already exists...'
end
go
if not exists(select schema_name from information_schema.schemata where schema_name = 'eeInf') begin
print 'Creating schema eeInf...'
exec sp_executesql N'create schema eeInf'
end else begin
print 'Schema eeInf already exists...'
end
go
drop procedure if exists clm.tryUpdateProgressRunQueue
go
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
create procedure clm.tryUpdateProgressRunQueue (
@runQueueId uniqueidentifier,
@progress decimal(18, 14),
@callCount bigint,
@relativeInvariant float,
@maxEe float,
@maxAverageEe float,
@maxWeightedAverageAbsEe float,
@maxLastEe float)
as
begin
declare @rowCount int
set nocount on;
-- Do something useful here.
set @rowCount = @@rowcount
select @rowCount as [RowCount]
end
go
drop procedure if exists eeInf.tryUpdateProgressRunQueue
go
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
create procedure eeInf.tryUpdateProgressRunQueue (
@runQueueId uniqueidentifier,
@progress decimal(18, 14),
@callCount bigint,
@relativeInvariant float,
@dummy float)
as
begin
declare @rowCount int
set nocount on;
-- Do something useful here.
set @rowCount = @@rowcount
select @rowCount as [RowCount]
end
go
I am using SQLProvider version 1.3.7 and MSSQL.
- 主要言語
- F#
- スター
- 627
- フォーク
- 147
- 平均マージ
- 2時間 2分
- マージ済み PR(30日)
- 1
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
fsprojects/SQLProvider のほかの issue
-
enhancement
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
fsprojects/SQLProvider#872 · コメント 2 件 ·
-
Repo Assist? オープンenhancement
難易度 5/5 1週間以上 初心者へのやさしさ 10/100
fsprojects/SQLProvider#870 · コメント 1 件 ·
-
postgresql
難易度 4/5 3〜5日 初心者へのやさしさ 58/100
fsprojects/SQLProvider#869 · コメント 2 件 ·
-
documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 42/100
fsprojects/SQLProvider#868 · コメント 2 件 ·
-
sql server
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
fsprojects/SQLProvider#851 · コメント 1 件 ·
fsprojects/SQLProvider の issue をすべて見る
似ている issue
-
channels:add check:passed
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
confluentinc/dbt-confluent#160 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 75/100
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
AstrBotDevs/AstrBot#10205 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100