MSSQL stored procedures does not correctly works with schemas
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
Bắt đầu bằng cách chạy các script schema MSSQL và stored-procedure được cung cấp, sau đó tái hiện vấn đề thông qua SqlDataProvider.GetDataContext và ctx.Procedures. Theo dõi cách các procedure có cùng tên trong clm và eeInf được phát hiện và hiển thị. Công việc được hoàn tất khi cả hai procedure dành riêng cho schema vẫn được phân biệt và Invoke hiển thị đúng các tham số cho từng procedure.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- F#
- Star
- 627
- Fork
- 147
- Merge trung bình
- 2 giờ 2 phút
- Pull request đã merge (30 ngày)
- 1
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của fsprojects/SQLProvider
-
enhancement
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 55/100
fsprojects/SQLProvider#872 · 2 bình luận ·
-
Repo Assist? Đang mởenhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 10/100
fsprojects/SQLProvider#870 · 1 bình luận ·
-
postgresql
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 58/100
fsprojects/SQLProvider#869 · 2 bình luận ·
-
documentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 42/100
fsprojects/SQLProvider#868 · 2 bình luận ·
-
sql server
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
fsprojects/SQLProvider#851 · 1 bình luận ·
Tất cả issue của fsprojects/SQLProvider
Issue tương tự
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 75/100
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
AstrBotDevs/AstrBot#10205 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
OHDSI/Data2Evidence#3394 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100