From f8cd3a7f6fa1692b468b94844b375d9eb161aade Mon Sep 17 00:00:00 2001 From: jeffovercash Date: Thu, 15 Feb 2024 15:40:50 -0500 Subject: [PATCH] 7.14.6 Update Improved ANSI character support (SJIS, Latin1 etc) MacOS loading works The Schema classes now have a global switch to emulate its output types to match the old Dbx based ADO driver. --- .../ChangeViews Demo/ChangeViews Demo.csproj | 83 +- .../ChangeViews Demo/ChangeViews Demo.sln | 2 +- .../Properties/AssemblyInfo.cs | 36 - .../ConnectionBuilder/ConnectionBuilder.sln | 2 +- .../ConnectionBuilder.csproj | 91 +- .../ConnectionBuilder/Form1.Designer.cs | 906 +++++++++--------- .../ConnectionBuilder/Form1.cs | 142 +-- .../ConnectionBuilder/Form1.resx | 50 +- .../Properties/AssemblyInfo.cs | 36 - .../Properties/Settings.Designer.cs | 21 +- .../Demos/EntityCore/EntityCoreExample.csproj | 5 +- .../Demos/EntityCore/Model/EmployeeContext.cs | 6 +- .../Demos/EntityCoreExample2/EFCore101.csproj | 4 +- .../SimpleGrid/Properties/AssemblyInfo.cs | 36 - .../Demos/SimpleGrid/SimpleDataGrid.csproj | 89 +- .../Demos/SimpleGrid/SimpleDataGrid.sln | 2 +- NETProvider/Provider/build.ps1 | 8 +- NETProvider/Provider/installer/Installer.wxs | 17 +- .../Provider/src/Directory.Build.props | 2 +- .../EntityFramework.InterBase.Tests.csproj | 3 +- .../EntityFramework.InterBase.csproj | 2 +- .../IBArrayTests.cs | 4 +- .../IBCommandTests.cs | 2 +- .../IBConnectionTests.cs | 3 +- .../IBDataReaderTests.cs | 24 +- .../IBServicesTests.cs | 4 +- ...rBaseSql.Data.InterBaseClient.Tests.csproj | 2 +- .../Client/Native/Changelog.md | 26 +- .../Client/Native/Changelog.txt | 161 ---- .../Client/Native/IBArray.cs | 4 +- .../Client/Native/IBClientFactory.cs | 12 +- .../Client/Native/IBStatement.cs | 38 +- .../Client/Native/LinuxClient.cs | 23 +- .../Client/Native/MacOSClient.cs | 13 +- .../Client/Native/Marshalers/Changelog.md | 52 + .../Client/Native/Marshalers/Changelog.txt | 47 - .../Native/Marshalers/XsqldaMarshaler.cs | 13 +- .../Common/ArrayBase.cs | 2 +- .../Common/Changelog.md | 32 +- .../Common/Charset.cs | 28 +- .../Common/ConnectionString.cs | 1 - .../Common/DbField.cs | 37 +- .../Common/DbValue.cs | 18 +- .../Common/Descriptor.cs | 9 +- .../Common/TypeHelper.cs | 40 +- .../Embarcadero.Data.InterBaseClient.csproj | 27 +- .../InterBaseClient/IBCharset.cs | 10 +- .../InterBaseClient/IBCommand.cs | 5 +- .../InterBaseClient/IBConnection.cs | 7 +- .../IBConnectionStringBuilder.cs | 61 +- .../InterBaseClient/IBDataReader.cs | 119 ++- .../InterBaseClient/changelog.md | 25 + .../Schema/Changelog.md | 15 + .../Schema/IBChecksByTable.cs | 2 +- .../Schema/IBColumns.cs | 23 +- .../Schema/IBDomains.cs | 2 +- .../Schema/IBForeignKeyColumns.cs | 60 +- .../Schema/IBForeignKeys.cs | 19 +- .../Schema/IBIndexColumns.cs | 30 +- .../Schema/IBIndexes.cs | 62 +- .../Schema/IBMetaData.xml | 124 +-- .../Schema/IBProcedureParameters.cs | 34 +- .../Schema/IBProcedures.cs | 10 + .../Schema/IBSchema.cs | 3 + .../Schema/IBSchemaFactory.cs | 4 +- .../Schema/IBTableConstraints.cs | 16 + .../Schema/IBViewColumns.cs | 2 +- ...eworkCore.InterBase.FunctionalTests.csproj | 1 + ...EntityFrameworkCore.InterBase.Tests.csproj | 1 + ...seSql.EntityFrameworkCore.InterBase.csproj | 3 +- NETProvider/Provider/src/Perf/Perf.csproj | 3 +- NETProvider/README.md | 16 + 72 files changed, 1494 insertions(+), 1328 deletions(-) delete mode 100644 NETProvider/Demos/ChangeViews Demo/Properties/AssemblyInfo.cs delete mode 100644 NETProvider/Demos/ConnectionBuilder/ConnectionBuilder/Properties/AssemblyInfo.cs delete mode 100644 NETProvider/Demos/SimpleGrid/Properties/AssemblyInfo.cs delete mode 100644 NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Client/Native/Changelog.txt create mode 100644 NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Client/Native/Marshalers/Changelog.md delete mode 100644 NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Client/Native/Marshalers/Changelog.txt diff --git a/NETProvider/Demos/ChangeViews Demo/ChangeViews Demo.csproj b/NETProvider/Demos/ChangeViews Demo/ChangeViews Demo.csproj index f3d8dac..fecfb89 100644 --- a/NETProvider/Demos/ChangeViews Demo/ChangeViews Demo.csproj +++ b/NETProvider/Demos/ChangeViews Demo/ChangeViews Demo.csproj @@ -1,86 +1,19 @@ - - - + - Debug - AnyCPU - {1B9C0326-7E38-460A-B6B0-C9318B6075DB} + net6.0-windows WinExe - ChangeViews_Demo - ChangeViews Demo - v4.5.2 - 512 - true - true - - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 + false + true + true ..\..\NETProvider\trunk\NETProvider\Provider\src\InterBaseSql.Data.InterBaseClient\obj\Debug\net452\InterBaseSql.Data.InterBaseClient.dll - - - - - - - - - - - - - - - Form - - - MainForm.cs - - - - - MainForm.cs - - - ResXFileCodeGenerator - Resources.Designer.cs - Designer - - - True - Resources.resx - - - SettingsSingleFileGenerator - Settings.Designer.cs - - - True - Settings.settings - True - - + + + - \ No newline at end of file diff --git a/NETProvider/Demos/ChangeViews Demo/ChangeViews Demo.sln b/NETProvider/Demos/ChangeViews Demo/ChangeViews Demo.sln index dc27087..791f15c 100644 --- a/NETProvider/Demos/ChangeViews Demo/ChangeViews Demo.sln +++ b/NETProvider/Demos/ChangeViews Demo/ChangeViews Demo.sln @@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 16 VisualStudioVersion = 16.0.31205.134 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ChangeViews Demo", "ChangeViews Demo.csproj", "{1B9C0326-7E38-460A-B6B0-C9318B6075DB}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ChangeViews Demo", "ChangeViews Demo.csproj", "{1B9C0326-7E38-460A-B6B0-C9318B6075DB}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/NETProvider/Demos/ChangeViews Demo/Properties/AssemblyInfo.cs b/NETProvider/Demos/ChangeViews Demo/Properties/AssemblyInfo.cs deleted file mode 100644 index 76eb868..0000000 --- a/NETProvider/Demos/ChangeViews Demo/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("ChangeViews Demo")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("ChangeViews Demo")] -[assembly: AssemblyCopyright("Copyright © 2021")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("1b9c0326-7e38-460a-b6b0-c9318b6075db")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/NETProvider/Demos/ConnectionBuilder/ConnectionBuilder.sln b/NETProvider/Demos/ConnectionBuilder/ConnectionBuilder.sln index b8cd599..a2a79e8 100644 --- a/NETProvider/Demos/ConnectionBuilder/ConnectionBuilder.sln +++ b/NETProvider/Demos/ConnectionBuilder/ConnectionBuilder.sln @@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 16 VisualStudioVersion = 16.0.30907.101 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConnectionBuilder", "ConnectionBuilder\ConnectionBuilder.csproj", "{EC6E1FFC-0076-4A45-B0C0-02A5AD3F85A1}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ConnectionBuilder", "ConnectionBuilder\ConnectionBuilder.csproj", "{EC6E1FFC-0076-4A45-B0C0-02A5AD3F85A1}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/NETProvider/Demos/ConnectionBuilder/ConnectionBuilder/ConnectionBuilder.csproj b/NETProvider/Demos/ConnectionBuilder/ConnectionBuilder/ConnectionBuilder.csproj index 5c948a8..a934baf 100644 --- a/NETProvider/Demos/ConnectionBuilder/ConnectionBuilder/ConnectionBuilder.csproj +++ b/NETProvider/Demos/ConnectionBuilder/ConnectionBuilder/ConnectionBuilder.csproj @@ -1,92 +1,33 @@ - - - + - Debug - AnyCPU - {EC6E1FFC-0076-4A45-B0C0-02A5AD3F85A1} + net6.0-windows WinExe - ConnectionBuilder - ConnectionBuilder - v4.7.2 - 512 - true - true - - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 + false + true + true False ..\..\NETProvider\trunk\NETProvider\Provider\src\InterBaseSql.Data.InterBaseClient\obj\Debug\net452\InterBaseSql.Data.InterBaseClient.dll - - - - - - - - - - - - - Form - - - Form1.cs - - - - - Form1.cs - - - ResXFileCodeGenerator - Resources.Designer.cs - Designer - - - True - Resources.resx - - - SettingsSingleFileGenerator - Settings.Designer.cs - - + + + + + + + True True Settings.settings - True - - - - - 7.11.0 - + + SettingsSingleFileGenerator + Settings.Designer.cs + - \ No newline at end of file diff --git a/NETProvider/Demos/ConnectionBuilder/ConnectionBuilder/Form1.Designer.cs b/NETProvider/Demos/ConnectionBuilder/ConnectionBuilder/Form1.Designer.cs index 7b2fba6..f88faa5 100644 --- a/NETProvider/Demos/ConnectionBuilder/ConnectionBuilder/Form1.Designer.cs +++ b/NETProvider/Demos/ConnectionBuilder/ConnectionBuilder/Form1.Designer.cs @@ -40,455 +40,465 @@ protected override void Dispose(bool disposing) base.Dispose(disposing); } - #region Windows Form Designer generated code + #region Windows Form Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.txtConnectionString = new System.Windows.Forms.TextBox(); - this.btnBuild = new System.Windows.Forms.Button(); - this.btnTest = new System.Windows.Forms.Button(); - this.label1 = new System.Windows.Forms.Label(); - this.txtServer = new System.Windows.Forms.TextBox(); - this.label2 = new System.Windows.Forms.Label(); - this.label3 = new System.Windows.Forms.Label(); - this.txtPath = new System.Windows.Forms.TextBox(); - this.numPort = new System.Windows.Forms.NumericUpDown(); - this.label4 = new System.Windows.Forms.Label(); - this.txtUser = new System.Windows.Forms.TextBox(); - this.txtPassword = new System.Windows.Forms.TextBox(); - this.label5 = new System.Windows.Forms.Label(); - this.label6 = new System.Windows.Forms.Label(); - this.cboDialect = new System.Windows.Forms.ComboBox(); - this.label7 = new System.Windows.Forms.Label(); - this.cboPacket = new System.Windows.Forms.ComboBox(); - this.label8 = new System.Windows.Forms.Label(); - this.cboCharSet = new System.Windows.Forms.ComboBox(); - this.label9 = new System.Windows.Forms.Label(); - this.cboServerType = new System.Windows.Forms.ComboBox(); - this.chkSSL = new System.Windows.Forms.CheckBox(); - this.label10 = new System.Windows.Forms.Label(); - this.label11 = new System.Windows.Forms.Label(); - this.label12 = new System.Windows.Forms.Label(); - this.txtSEPPassword = new System.Windows.Forms.TextBox(); - this.label13 = new System.Windows.Forms.Label(); - this.label14 = new System.Windows.Forms.Label(); - this.label15 = new System.Windows.Forms.Label(); - this.txtServerPublicFile = new System.Windows.Forms.TextBox(); - this.txtServerPublicPath = new System.Windows.Forms.TextBox(); - this.txtClientCertFile = new System.Windows.Forms.TextBox(); - this.txtClientPassPhraseFile = new System.Windows.Forms.TextBox(); - this.txtClientPassPhrase = new System.Windows.Forms.TextBox(); - ((System.ComponentModel.ISupportInitialize)(this.numPort)).BeginInit(); - this.SuspendLayout(); - // - // txtConnectionString - // - this.txtConnectionString.Dock = System.Windows.Forms.DockStyle.Bottom; - this.txtConnectionString.Location = new System.Drawing.Point(0, 326); - this.txtConnectionString.Multiline = true; - this.txtConnectionString.Name = "txtConnectionString"; - this.txtConnectionString.ScrollBars = System.Windows.Forms.ScrollBars.Both; - this.txtConnectionString.Size = new System.Drawing.Size(800, 78); - this.txtConnectionString.TabIndex = 0; - // - // btnBuild - // - this.btnBuild.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.btnBuild.Location = new System.Drawing.Point(24, 297); - this.btnBuild.Name = "btnBuild"; - this.btnBuild.Size = new System.Drawing.Size(75, 23); - this.btnBuild.TabIndex = 1; - this.btnBuild.Text = "Build String"; - this.btnBuild.UseVisualStyleBackColor = true; - this.btnBuild.Click += new System.EventHandler(this.btnBuild_Click); - // - // btnTest - // - this.btnTest.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.btnTest.Location = new System.Drawing.Point(679, 297); - this.btnTest.Name = "btnTest"; - this.btnTest.Size = new System.Drawing.Size(109, 23); - this.btnTest.TabIndex = 2; - this.btnTest.Text = "Test Connection"; - this.btnTest.UseVisualStyleBackColor = true; - this.btnTest.Click += new System.EventHandler(this.btnTest_Click); - // - // label1 - // - this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(32, 19); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(38, 13); - this.label1.TabIndex = 3; - this.label1.Text = "Server"; - // - // txtServer - // - this.txtServer.Location = new System.Drawing.Point(76, 15); - this.txtServer.Name = "txtServer"; - this.txtServer.Size = new System.Drawing.Size(118, 20); - this.txtServer.TabIndex = 4; - this.txtServer.Text = "localhost"; - // - // label2 - // - this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(200, 19); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(78, 13); - this.label2.TabIndex = 5; - this.label2.Text = "Database Path"; - // - // label3 - // - this.label3.AutoSize = true; - this.label3.Location = new System.Drawing.Point(44, 51); - this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(26, 13); - this.label3.TabIndex = 6; - this.label3.Text = "Port"; - // - // txtPath - // - this.txtPath.Location = new System.Drawing.Point(284, 15); - this.txtPath.Name = "txtPath"; - this.txtPath.Size = new System.Drawing.Size(504, 20); - this.txtPath.TabIndex = 7; - // - // numPort - // - this.numPort.Location = new System.Drawing.Point(76, 47); - this.numPort.Maximum = new decimal(new int[] { - 64000, - 0, - 0, - 0}); - this.numPort.Name = "numPort"; - this.numPort.Size = new System.Drawing.Size(115, 20); - this.numPort.TabIndex = 8; - this.numPort.Value = new decimal(new int[] { - 3050, - 0, - 0, - 0}); - // - // label4 - // - this.label4.AutoSize = true; - this.label4.Location = new System.Drawing.Point(232, 51); - this.label4.Name = "label4"; - this.label4.Size = new System.Drawing.Size(29, 13); - this.label4.TabIndex = 9; - this.label4.Text = "User"; - // - // txtUser - // - this.txtUser.Location = new System.Drawing.Point(267, 47); - this.txtUser.Name = "txtUser"; - this.txtUser.Size = new System.Drawing.Size(147, 20); - this.txtUser.TabIndex = 10; - this.txtUser.Text = "sysdba"; - // - // txtPassword - // - this.txtPassword.Location = new System.Drawing.Point(553, 47); - this.txtPassword.Name = "txtPassword"; - this.txtPassword.Size = new System.Drawing.Size(116, 20); - this.txtPassword.TabIndex = 11; - this.txtPassword.Text = "masterkey"; - // - // label5 - // - this.label5.AutoSize = true; - this.label5.Location = new System.Drawing.Point(494, 51); - this.label5.Name = "label5"; - this.label5.Size = new System.Drawing.Size(53, 13); - this.label5.TabIndex = 12; - this.label5.Text = "Password"; - // - // label6 - // - this.label6.AutoSize = true; - this.label6.Location = new System.Drawing.Point(690, 51); - this.label6.Name = "label6"; - this.label6.Size = new System.Drawing.Size(40, 13); - this.label6.TabIndex = 13; - this.label6.Text = "Dialect"; - // - // cboDialect - // - this.cboDialect.FormattingEnabled = true; - this.cboDialect.Items.AddRange(new object[] { - "1", - "2", - "3"}); - this.cboDialect.Location = new System.Drawing.Point(736, 47); - this.cboDialect.Name = "cboDialect"; - this.cboDialect.Size = new System.Drawing.Size(52, 21); - this.cboDialect.TabIndex = 14; - this.cboDialect.Text = "3"; - // - // label7 - // - this.label7.AutoSize = true; - this.label7.Location = new System.Drawing.Point(6, 88); - this.label7.Name = "label7"; - this.label7.Size = new System.Drawing.Size(64, 13); - this.label7.TabIndex = 15; - this.label7.Text = "Packet Size"; - // - // cboPacket - // - this.cboPacket.FormattingEnabled = true; - this.cboPacket.Items.AddRange(new object[] { - "1024", - "2048", - "4096", - "8192", - "16284"}); - this.cboPacket.Location = new System.Drawing.Point(76, 85); - this.cboPacket.Name = "cboPacket"; - this.cboPacket.Size = new System.Drawing.Size(115, 21); - this.cboPacket.TabIndex = 16; - this.cboPacket.Text = "8192"; - // - // label8 - // - this.label8.AutoSize = true; - this.label8.Location = new System.Drawing.Point(211, 89); - this.label8.Name = "label8"; - this.label8.Size = new System.Drawing.Size(48, 13); - this.label8.TabIndex = 17; - this.label8.Text = "Char Set"; - // - // cboCharSet - // - this.cboCharSet.FormattingEnabled = true; - this.cboCharSet.Items.AddRange(new object[] { - "None", - "Octets", - "Ascii", - "UnicodeFss", - "Utf8", - "ShiftJis0208", - "EucJapanese0208", - "Iso2022Japanese", - "Dos437", - "Dos850", - "Dos865", - "Dos860", - "Dos863", - "Iso8859_1", - "Iso8859_2", - "Ksc5601", - "Dos861", - "Windows1250", - "Windows1251", - "Windows1252", - "Windows1253", - "Windows1254", - "Big5", - "Gb2312", - "Windows1255", - "Windows1256", - "Windows1257", - "Koi8R", - "Koi8U", - "TIS620"}); - this.cboCharSet.Location = new System.Drawing.Point(268, 85); - this.cboCharSet.Name = "cboCharSet"; - this.cboCharSet.Size = new System.Drawing.Size(146, 21); - this.cboCharSet.TabIndex = 18; - this.cboCharSet.Text = "None"; - // - // label9 - // - this.label9.AutoSize = true; - this.label9.Location = new System.Drawing.Point(420, 89); - this.label9.Name = "label9"; - this.label9.Size = new System.Drawing.Size(65, 13); - this.label9.TabIndex = 19; - this.label9.Text = "Server Type"; - // - // cboServerType - // - this.cboServerType.FormattingEnabled = true; - this.cboServerType.Items.AddRange(new object[] { - "Default", - "Embedded"}); - this.cboServerType.Location = new System.Drawing.Point(491, 86); - this.cboServerType.Name = "cboServerType"; - this.cboServerType.Size = new System.Drawing.Size(121, 21); - this.cboServerType.TabIndex = 20; - this.cboServerType.Text = "Default"; - // - // chkSSL - // - this.chkSSL.AutoSize = true; - this.chkSSL.Location = new System.Drawing.Point(393, 134); - this.chkSSL.Name = "chkSSL"; - this.chkSSL.RightToLeft = System.Windows.Forms.RightToLeft.Yes; - this.chkSSL.Size = new System.Drawing.Size(46, 17); - this.chkSSL.TabIndex = 21; - this.chkSSL.Text = "SSL"; - this.chkSSL.UseVisualStyleBackColor = true; - this.chkSSL.CheckedChanged += new System.EventHandler(this.chkSSL_CheckedChanged); - // - // label10 - // - this.label10.AutoSize = true; - this.label10.Location = new System.Drawing.Point(32, 184); - this.label10.Name = "label10"; - this.label10.Size = new System.Drawing.Size(95, 13); - this.label10.TabIndex = 22; - this.label10.Text = "Server Public Path"; - // - // label11 - // - this.label11.AutoSize = true; - this.label11.Location = new System.Drawing.Point(53, 210); - this.label11.Name = "label11"; - this.label11.Size = new System.Drawing.Size(74, 13); - this.label11.TabIndex = 23; - this.label11.Text = "Client Cert File"; - // - // label12 - // - this.label12.AutoSize = true; - this.label12.Location = new System.Drawing.Point(618, 89); - this.label12.Name = "label12"; - this.label12.Size = new System.Drawing.Size(77, 13); - this.label12.TabIndex = 24; - this.label12.Text = "SEP Password"; - // - // txtSEPPassword - // - this.txtSEPPassword.Location = new System.Drawing.Point(693, 85); - this.txtSEPPassword.Name = "txtSEPPassword"; - this.txtSEPPassword.Size = new System.Drawing.Size(95, 20); - this.txtSEPPassword.TabIndex = 25; - // - // label13 - // - this.label13.AutoSize = true; - this.label13.Location = new System.Drawing.Point(13, 237); - this.label13.Name = "label13"; - this.label13.Size = new System.Drawing.Size(114, 13); - this.label13.TabIndex = 26; - this.label13.Text = "Client Pass Phrase File"; - // - // label14 - // - this.label14.AutoSize = true; - this.label14.Location = new System.Drawing.Point(32, 262); - this.label14.Name = "label14"; - this.label14.Size = new System.Drawing.Size(95, 13); - this.label14.TabIndex = 27; - this.label14.Text = "Client Pass Phrase"; - // - // label15 - // - this.label15.AutoSize = true; - this.label15.Location = new System.Drawing.Point(38, 160); - this.label15.Name = "label15"; - this.label15.Size = new System.Drawing.Size(89, 13); - this.label15.TabIndex = 28; - this.label15.Text = "Server Public File"; - // - // txtServerPublicFile - // - this.txtServerPublicFile.Enabled = false; - this.txtServerPublicFile.Location = new System.Drawing.Point(145, 157); - this.txtServerPublicFile.Name = "txtServerPublicFile"; - this.txtServerPublicFile.Size = new System.Drawing.Size(643, 20); - this.txtServerPublicFile.TabIndex = 29; - // - // txtServerPublicPath - // - this.txtServerPublicPath.Enabled = false; - this.txtServerPublicPath.Location = new System.Drawing.Point(145, 181); - this.txtServerPublicPath.Name = "txtServerPublicPath"; - this.txtServerPublicPath.Size = new System.Drawing.Size(643, 20); - this.txtServerPublicPath.TabIndex = 30; - // - // txtClientCertFile - // - this.txtClientCertFile.Enabled = false; - this.txtClientCertFile.Location = new System.Drawing.Point(145, 207); - this.txtClientCertFile.Name = "txtClientCertFile"; - this.txtClientCertFile.Size = new System.Drawing.Size(643, 20); - this.txtClientCertFile.TabIndex = 31; - // - // txtClientPassPhraseFile - // - this.txtClientPassPhraseFile.Enabled = false; - this.txtClientPassPhraseFile.Location = new System.Drawing.Point(145, 233); - this.txtClientPassPhraseFile.Name = "txtClientPassPhraseFile"; - this.txtClientPassPhraseFile.Size = new System.Drawing.Size(643, 20); - this.txtClientPassPhraseFile.TabIndex = 32; - // - // txtClientPassPhrase - // - this.txtClientPassPhrase.Enabled = false; - this.txtClientPassPhrase.Location = new System.Drawing.Point(145, 259); - this.txtClientPassPhrase.Name = "txtClientPassPhrase"; - this.txtClientPassPhrase.Size = new System.Drawing.Size(643, 20); - this.txtClientPassPhrase.TabIndex = 33; - // - // frmMain - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(800, 404); - this.Controls.Add(this.txtClientPassPhrase); - this.Controls.Add(this.txtClientPassPhraseFile); - this.Controls.Add(this.txtClientCertFile); - this.Controls.Add(this.txtServerPublicPath); - this.Controls.Add(this.txtServerPublicFile); - this.Controls.Add(this.label15); - this.Controls.Add(this.label14); - this.Controls.Add(this.label13); - this.Controls.Add(this.txtSEPPassword); - this.Controls.Add(this.label12); - this.Controls.Add(this.label11); - this.Controls.Add(this.label10); - this.Controls.Add(this.chkSSL); - this.Controls.Add(this.cboServerType); - this.Controls.Add(this.label9); - this.Controls.Add(this.cboCharSet); - this.Controls.Add(this.label8); - this.Controls.Add(this.cboPacket); - this.Controls.Add(this.label7); - this.Controls.Add(this.cboDialect); - this.Controls.Add(this.label6); - this.Controls.Add(this.label5); - this.Controls.Add(this.txtPassword); - this.Controls.Add(this.txtUser); - this.Controls.Add(this.label4); - this.Controls.Add(this.numPort); - this.Controls.Add(this.txtPath); - this.Controls.Add(this.label3); - this.Controls.Add(this.label2); - this.Controls.Add(this.txtServer); - this.Controls.Add(this.label1); - this.Controls.Add(this.btnTest); - this.Controls.Add(this.btnBuild); - this.Controls.Add(this.txtConnectionString); - this.Name = "frmMain"; - this.Text = "IB Connection Builder"; - ((System.ComponentModel.ISupportInitialize)(this.numPort)).EndInit(); - this.ResumeLayout(false); - this.PerformLayout(); - - } + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + txtConnectionString = new System.Windows.Forms.TextBox(); + btnBuild = new System.Windows.Forms.Button(); + btnTest = new System.Windows.Forms.Button(); + label1 = new System.Windows.Forms.Label(); + txtServer = new System.Windows.Forms.TextBox(); + label2 = new System.Windows.Forms.Label(); + label3 = new System.Windows.Forms.Label(); + txtPath = new System.Windows.Forms.TextBox(); + numPort = new System.Windows.Forms.NumericUpDown(); + label4 = new System.Windows.Forms.Label(); + txtUser = new System.Windows.Forms.TextBox(); + txtPassword = new System.Windows.Forms.TextBox(); + label5 = new System.Windows.Forms.Label(); + label6 = new System.Windows.Forms.Label(); + cboDialect = new System.Windows.Forms.ComboBox(); + label7 = new System.Windows.Forms.Label(); + cboPacket = new System.Windows.Forms.ComboBox(); + label8 = new System.Windows.Forms.Label(); + cboCharSet = new System.Windows.Forms.ComboBox(); + label9 = new System.Windows.Forms.Label(); + cboServerType = new System.Windows.Forms.ComboBox(); + chkSSL = new System.Windows.Forms.CheckBox(); + label10 = new System.Windows.Forms.Label(); + label11 = new System.Windows.Forms.Label(); + label12 = new System.Windows.Forms.Label(); + txtSEPPassword = new System.Windows.Forms.TextBox(); + label13 = new System.Windows.Forms.Label(); + label14 = new System.Windows.Forms.Label(); + label15 = new System.Windows.Forms.Label(); + txtServerPublicFile = new System.Windows.Forms.TextBox(); + txtServerPublicPath = new System.Windows.Forms.TextBox(); + txtClientCertFile = new System.Windows.Forms.TextBox(); + txtClientPassPhraseFile = new System.Windows.Forms.TextBox(); + txtClientPassPhrase = new System.Windows.Forms.TextBox(); + button1 = new System.Windows.Forms.Button(); + button2 = new System.Windows.Forms.Button(); + ((System.ComponentModel.ISupportInitialize)numPort).BeginInit(); + SuspendLayout(); + // + // txtConnectionString + // + txtConnectionString.Dock = System.Windows.Forms.DockStyle.Bottom; + txtConnectionString.Location = new System.Drawing.Point(0, 377); + txtConnectionString.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + txtConnectionString.Multiline = true; + txtConnectionString.Name = "txtConnectionString"; + txtConnectionString.ScrollBars = System.Windows.Forms.ScrollBars.Both; + txtConnectionString.Size = new System.Drawing.Size(933, 89); + txtConnectionString.TabIndex = 0; + // + // btnBuild + // + btnBuild.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left; + btnBuild.Location = new System.Drawing.Point(28, 343); + btnBuild.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + btnBuild.Name = "btnBuild"; + btnBuild.Size = new System.Drawing.Size(88, 27); + btnBuild.TabIndex = 1; + btnBuild.Text = "Build String"; + btnBuild.UseVisualStyleBackColor = true; + btnBuild.Click += btnBuild_Click; + // + // btnTest + // + btnTest.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left; + btnTest.Location = new System.Drawing.Point(792, 343); + btnTest.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + btnTest.Name = "btnTest"; + btnTest.Size = new System.Drawing.Size(127, 27); + btnTest.TabIndex = 2; + btnTest.Text = "Test Connection"; + btnTest.UseVisualStyleBackColor = true; + btnTest.Click += btnTest_Click; + // + // label1 + // + label1.AutoSize = true; + label1.Location = new System.Drawing.Point(37, 22); + label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + label1.Name = "label1"; + label1.Size = new System.Drawing.Size(39, 15); + label1.TabIndex = 3; + label1.Text = "Server"; + // + // txtServer + // + txtServer.Location = new System.Drawing.Point(89, 17); + txtServer.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + txtServer.Name = "txtServer"; + txtServer.Size = new System.Drawing.Size(137, 23); + txtServer.TabIndex = 4; + txtServer.Text = "localhost"; + // + // label2 + // + label2.AutoSize = true; + label2.Location = new System.Drawing.Point(233, 22); + label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + label2.Name = "label2"; + label2.Size = new System.Drawing.Size(82, 15); + label2.TabIndex = 5; + label2.Text = "Database Path"; + // + // label3 + // + label3.AutoSize = true; + label3.Location = new System.Drawing.Point(51, 59); + label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + label3.Name = "label3"; + label3.Size = new System.Drawing.Size(29, 15); + label3.TabIndex = 6; + label3.Text = "Port"; + // + // txtPath + // + txtPath.Location = new System.Drawing.Point(331, 17); + txtPath.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + txtPath.Name = "txtPath"; + txtPath.Size = new System.Drawing.Size(587, 23); + txtPath.TabIndex = 7; + // + // numPort + // + numPort.Location = new System.Drawing.Point(89, 54); + numPort.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + numPort.Maximum = new decimal(new int[] { 64000, 0, 0, 0 }); + numPort.Name = "numPort"; + numPort.Size = new System.Drawing.Size(134, 23); + numPort.TabIndex = 8; + numPort.Value = new decimal(new int[] { 3050, 0, 0, 0 }); + // + // label4 + // + label4.AutoSize = true; + label4.Location = new System.Drawing.Point(271, 59); + label4.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + label4.Name = "label4"; + label4.Size = new System.Drawing.Size(30, 15); + label4.TabIndex = 9; + label4.Text = "User"; + // + // txtUser + // + txtUser.Location = new System.Drawing.Point(312, 54); + txtUser.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + txtUser.Name = "txtUser"; + txtUser.Size = new System.Drawing.Size(171, 23); + txtUser.TabIndex = 10; + txtUser.Text = "sysdba"; + // + // txtPassword + // + txtPassword.Location = new System.Drawing.Point(645, 54); + txtPassword.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + txtPassword.Name = "txtPassword"; + txtPassword.Size = new System.Drawing.Size(135, 23); + txtPassword.TabIndex = 11; + txtPassword.Text = "masterkey"; + // + // label5 + // + label5.AutoSize = true; + label5.Location = new System.Drawing.Point(576, 59); + label5.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + label5.Name = "label5"; + label5.Size = new System.Drawing.Size(57, 15); + label5.TabIndex = 12; + label5.Text = "Password"; + // + // label6 + // + label6.AutoSize = true; + label6.Location = new System.Drawing.Point(805, 59); + label6.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + label6.Name = "label6"; + label6.Size = new System.Drawing.Size(43, 15); + label6.TabIndex = 13; + label6.Text = "Dialect"; + // + // cboDialect + // + cboDialect.FormattingEnabled = true; + cboDialect.Items.AddRange(new object[] { "1", "2", "3" }); + cboDialect.Location = new System.Drawing.Point(859, 54); + cboDialect.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + cboDialect.Name = "cboDialect"; + cboDialect.Size = new System.Drawing.Size(60, 23); + cboDialect.TabIndex = 14; + cboDialect.Text = "3"; + // + // label7 + // + label7.AutoSize = true; + label7.Location = new System.Drawing.Point(7, 102); + label7.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + label7.Name = "label7"; + label7.Size = new System.Drawing.Size(65, 15); + label7.TabIndex = 15; + label7.Text = "Packet Size"; + // + // cboPacket + // + cboPacket.FormattingEnabled = true; + cboPacket.Items.AddRange(new object[] { "1024", "2048", "4096", "8192", "16284" }); + cboPacket.Location = new System.Drawing.Point(89, 98); + cboPacket.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + cboPacket.Name = "cboPacket"; + cboPacket.Size = new System.Drawing.Size(134, 23); + cboPacket.TabIndex = 16; + cboPacket.Text = "8192"; + // + // label8 + // + label8.AutoSize = true; + label8.Location = new System.Drawing.Point(246, 103); + label8.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + label8.Name = "label8"; + label8.Size = new System.Drawing.Size(51, 15); + label8.TabIndex = 17; + label8.Text = "Char Set"; + // + // cboCharSet + // + cboCharSet.FormattingEnabled = true; + cboCharSet.Items.AddRange(new object[] { "None", "Octets", "Ascii", "UnicodeFss", "Utf8", "ShiftJis0208", "EucJapanese0208", "Iso2022Japanese", "Dos437", "Dos850", "Dos865", "Dos860", "Dos863", "Iso8859_1", "Iso8859_2", "Ksc5601", "Dos861", "Windows1250", "Windows1251", "Windows1252", "Windows1253", "Windows1254", "Big5", "Gb2312", "Windows1255", "Windows1256", "Windows1257", "Koi8R", "Koi8U", "TIS620" }); + cboCharSet.Location = new System.Drawing.Point(313, 98); + cboCharSet.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + cboCharSet.Name = "cboCharSet"; + cboCharSet.Size = new System.Drawing.Size(170, 23); + cboCharSet.TabIndex = 18; + cboCharSet.Text = "None"; + // + // label9 + // + label9.AutoSize = true; + label9.Location = new System.Drawing.Point(490, 103); + label9.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + label9.Name = "label9"; + label9.Size = new System.Drawing.Size(66, 15); + label9.TabIndex = 19; + label9.Text = "Server Type"; + // + // cboServerType + // + cboServerType.FormattingEnabled = true; + cboServerType.Items.AddRange(new object[] { "Default", "Embedded" }); + cboServerType.Location = new System.Drawing.Point(573, 99); + cboServerType.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + cboServerType.Name = "cboServerType"; + cboServerType.Size = new System.Drawing.Size(140, 23); + cboServerType.TabIndex = 20; + cboServerType.Text = "Default"; + // + // chkSSL + // + chkSSL.AutoSize = true; + chkSSL.Location = new System.Drawing.Point(458, 155); + chkSSL.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + chkSSL.Name = "chkSSL"; + chkSSL.RightToLeft = System.Windows.Forms.RightToLeft.Yes; + chkSSL.Size = new System.Drawing.Size(44, 19); + chkSSL.TabIndex = 21; + chkSSL.Text = "SSL"; + chkSSL.UseVisualStyleBackColor = true; + chkSSL.CheckedChanged += chkSSL_CheckedChanged; + // + // label10 + // + label10.AutoSize = true; + label10.Location = new System.Drawing.Point(37, 212); + label10.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + label10.Name = "label10"; + label10.Size = new System.Drawing.Size(102, 15); + label10.TabIndex = 22; + label10.Text = "Server Public Path"; + // + // label11 + // + label11.AutoSize = true; + label11.Location = new System.Drawing.Point(62, 242); + label11.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + label11.Name = "label11"; + label11.Size = new System.Drawing.Size(84, 15); + label11.TabIndex = 23; + label11.Text = "Client Cert File"; + // + // label12 + // + label12.AutoSize = true; + label12.Location = new System.Drawing.Point(721, 103); + label12.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + label12.Name = "label12"; + label12.Size = new System.Drawing.Size(79, 15); + label12.TabIndex = 24; + label12.Text = "SEP Password"; + // + // txtSEPPassword + // + txtSEPPassword.Location = new System.Drawing.Point(808, 98); + txtSEPPassword.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + txtSEPPassword.Name = "txtSEPPassword"; + txtSEPPassword.Size = new System.Drawing.Size(110, 23); + txtSEPPassword.TabIndex = 25; + // + // label13 + // + label13.AutoSize = true; + label13.Location = new System.Drawing.Point(15, 273); + label13.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + label13.Name = "label13"; + label13.Size = new System.Drawing.Size(123, 15); + label13.TabIndex = 26; + label13.Text = "Client Pass Phrase File"; + // + // label14 + // + label14.AutoSize = true; + label14.Location = new System.Drawing.Point(37, 302); + label14.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + label14.Name = "label14"; + label14.Size = new System.Drawing.Size(102, 15); + label14.TabIndex = 27; + label14.Text = "Client Pass Phrase"; + // + // label15 + // + label15.AutoSize = true; + label15.Location = new System.Drawing.Point(44, 185); + label15.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + label15.Name = "label15"; + label15.Size = new System.Drawing.Size(96, 15); + label15.TabIndex = 28; + label15.Text = "Server Public File"; + // + // txtServerPublicFile + // + txtServerPublicFile.Enabled = false; + txtServerPublicFile.Location = new System.Drawing.Point(169, 181); + txtServerPublicFile.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + txtServerPublicFile.Name = "txtServerPublicFile"; + txtServerPublicFile.Size = new System.Drawing.Size(750, 23); + txtServerPublicFile.TabIndex = 29; + // + // txtServerPublicPath + // + txtServerPublicPath.Enabled = false; + txtServerPublicPath.Location = new System.Drawing.Point(169, 209); + txtServerPublicPath.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + txtServerPublicPath.Name = "txtServerPublicPath"; + txtServerPublicPath.Size = new System.Drawing.Size(750, 23); + txtServerPublicPath.TabIndex = 30; + // + // txtClientCertFile + // + txtClientCertFile.Enabled = false; + txtClientCertFile.Location = new System.Drawing.Point(169, 239); + txtClientCertFile.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + txtClientCertFile.Name = "txtClientCertFile"; + txtClientCertFile.Size = new System.Drawing.Size(750, 23); + txtClientCertFile.TabIndex = 31; + // + // txtClientPassPhraseFile + // + txtClientPassPhraseFile.Enabled = false; + txtClientPassPhraseFile.Location = new System.Drawing.Point(169, 269); + txtClientPassPhraseFile.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + txtClientPassPhraseFile.Name = "txtClientPassPhraseFile"; + txtClientPassPhraseFile.Size = new System.Drawing.Size(750, 23); + txtClientPassPhraseFile.TabIndex = 32; + // + // txtClientPassPhrase + // + txtClientPassPhrase.Enabled = false; + txtClientPassPhrase.Location = new System.Drawing.Point(169, 299); + txtClientPassPhrase.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + txtClientPassPhrase.Name = "txtClientPassPhrase"; + txtClientPassPhrase.Size = new System.Drawing.Size(750, 23); + txtClientPassPhrase.TabIndex = 33; + // + // button1 + // + button1.Location = new System.Drawing.Point(257, 347); + button1.Name = "button1"; + button1.Size = new System.Drawing.Size(106, 21); + button1.TabIndex = 34; + button1.Text = "Load from XML"; + button1.UseVisualStyleBackColor = true; + button1.Click += button1_Click; + // + // button2 + // + button2.Location = new System.Drawing.Point(141, 346); + button2.Name = "button2"; + button2.Size = new System.Drawing.Size(96, 22); + button2.TabIndex = 35; + button2.Text = "Write To XML"; + button2.UseVisualStyleBackColor = true; + button2.Click += button2_Click; + // + // frmMain + // + AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); + AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + ClientSize = new System.Drawing.Size(933, 466); + Controls.Add(button2); + Controls.Add(button1); + Controls.Add(txtClientPassPhrase); + Controls.Add(txtClientPassPhraseFile); + Controls.Add(txtClientCertFile); + Controls.Add(txtServerPublicPath); + Controls.Add(txtServerPublicFile); + Controls.Add(label15); + Controls.Add(label14); + Controls.Add(label13); + Controls.Add(txtSEPPassword); + Controls.Add(label12); + Controls.Add(label11); + Controls.Add(label10); + Controls.Add(chkSSL); + Controls.Add(cboServerType); + Controls.Add(label9); + Controls.Add(cboCharSet); + Controls.Add(label8); + Controls.Add(cboPacket); + Controls.Add(label7); + Controls.Add(cboDialect); + Controls.Add(label6); + Controls.Add(label5); + Controls.Add(txtPassword); + Controls.Add(txtUser); + Controls.Add(label4); + Controls.Add(numPort); + Controls.Add(txtPath); + Controls.Add(label3); + Controls.Add(label2); + Controls.Add(txtServer); + Controls.Add(label1); + Controls.Add(btnTest); + Controls.Add(btnBuild); + Controls.Add(txtConnectionString); + Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + Name = "frmMain"; + Text = "IB Connection Builder"; + ((System.ComponentModel.ISupportInitialize)numPort).EndInit(); + ResumeLayout(false); + PerformLayout(); + } - #endregion + #endregion - private System.Windows.Forms.TextBox txtConnectionString; + private System.Windows.Forms.TextBox txtConnectionString; private System.Windows.Forms.Button btnBuild; private System.Windows.Forms.Button btnTest; private System.Windows.Forms.Label label1; @@ -522,6 +532,8 @@ private void InitializeComponent() private System.Windows.Forms.TextBox txtClientCertFile; private System.Windows.Forms.TextBox txtClientPassPhraseFile; private System.Windows.Forms.TextBox txtClientPassPhrase; - } + private System.Windows.Forms.Button button1; + private System.Windows.Forms.Button button2; + } } diff --git a/NETProvider/Demos/ConnectionBuilder/ConnectionBuilder/Form1.cs b/NETProvider/Demos/ConnectionBuilder/ConnectionBuilder/Form1.cs index 88c0aec..2ba9fb9 100644 --- a/NETProvider/Demos/ConnectionBuilder/ConnectionBuilder/Form1.cs +++ b/NETProvider/Demos/ConnectionBuilder/ConnectionBuilder/Form1.cs @@ -31,73 +31,87 @@ namespace ConnectionBuilder { - public partial class frmMain : Form - { - public frmMain() - { - InitializeComponent(); - } + public partial class frmMain : Form + { + public frmMain() + { + InitializeComponent(); + } - private void btnBuild_Click(object sender, EventArgs e) - { - var cs = new IBConnectionStringBuilder(); - if (txtServer.Text != "") - cs.DataSource = txtServer.Text; - cs.Database = txtPath.Text; - if (numPort.Value != 3050) - cs.Port = (int) numPort.Value; - cs.UserID = txtUser.Text; - cs.Password = txtPassword.Text; - if (cboDialect.Text != "3") - cs.Dialect = Int32.Parse(cboDialect.Text); - if (cboPacket.Text != "8192") - cs.PacketSize = Int32.Parse(cboPacket.Text); - if (cboCharSet.Text != "None") - cs.Charset = cboCharSet.Text; - if (cboServerType.Text != "Default") - cs.ServerType = IBServerType.Embedded; - if (txtSEPPassword.Text != "") - cs.SEPPassword = txtSEPPassword.Text; - if (chkSSL.Checked) - { - cs.SSL = true; - if (txtServerPublicFile.Text != "") - cs.ServerPublicFile = txtServerPublicFile.Text; - if (txtServerPublicPath.Text != "") - cs.ServerPublicPath = txtServerPublicPath.Text; - if (txtClientCertFile.Text != "") - cs.ClientCertFile = txtClientCertFile.Text; - if (txtClientPassPhraseFile.Text != "") - cs.ClientPassPhraseFile = txtClientPassPhraseFile.Text; - if (txtClientPassPhrase.Text != "") - cs.ClientPassPhrase = txtClientPassPhrase.Text; - } + private void btnBuild_Click(object sender, EventArgs e) + { + var cs = new IBConnectionStringBuilder(); + if (txtServer.Text != "") + cs.DataSource = txtServer.Text; + if (txtPath.Text != "") + cs.Database = txtPath.Text; + if (numPort.Value != 3050) + cs.Port = (int)numPort.Value; + cs.UserID = txtUser.Text; + cs.Password = txtPassword.Text; + if (cboDialect.Text != "3") + cs.Dialect = Int32.Parse(cboDialect.Text); + if (cboPacket.Text != "8192") + cs.PacketSize = Int32.Parse(cboPacket.Text); + if (cboCharSet.Text != "None") + cs.Charset = cboCharSet.Text; + if (cboServerType.Text != "Default") + cs.ServerType = IBServerType.Embedded; + if (txtSEPPassword.Text != "") + cs.SEPPassword = txtSEPPassword.Text; + if (chkSSL.Checked) + { + cs.SSL = true; + if (txtServerPublicFile.Text != "") + cs.ServerPublicFile = txtServerPublicFile.Text; + if (txtServerPublicPath.Text != "") + cs.ServerPublicPath = txtServerPublicPath.Text; + if (txtClientCertFile.Text != "") + cs.ClientCertFile = txtClientCertFile.Text; + if (txtClientPassPhraseFile.Text != "") + cs.ClientPassPhraseFile = txtClientPassPhraseFile.Text; + if (txtClientPassPhrase.Text != "") + cs.ClientPassPhrase = txtClientPassPhrase.Text; + } - txtConnectionString.Text = cs.ConnectionString; - } + txtConnectionString.Text = cs.ConnectionString; + } - private void btnTest_Click(object sender, EventArgs e) - { - var conn = new IBConnection(txtConnectionString.Text); - try - { - conn.Open(); - MessageBox.Show("Successful connection!", "Success"); - } - catch (Exception ex) - { - MessageBox.Show($"Connection failure {ex.Message}", "Failed"); - } + private void btnTest_Click(object sender, EventArgs e) + { + var conn = new IBConnection(txtConnectionString.Text); + try + { + conn.Open(); + MessageBox.Show("Successful connection!", "Success"); + } + catch (Exception ex) + { + MessageBox.Show($"Connection failure {ex.Message}", "Failed"); + } - } + } - private void chkSSL_CheckedChanged(object sender, EventArgs e) - { - txtServerPublicFile.Enabled = ((CheckBox)sender).Checked; - txtServerPublicPath.Enabled = ((CheckBox)sender).Checked; - txtClientCertFile.Enabled = ((CheckBox)sender).Checked; - txtClientPassPhraseFile.Enabled = ((CheckBox)sender).Checked; - txtClientPassPhrase.Enabled = ((CheckBox)sender).Checked; - } - } + private void chkSSL_CheckedChanged(object sender, EventArgs e) + { + txtServerPublicFile.Enabled = ((CheckBox)sender).Checked; + txtServerPublicPath.Enabled = ((CheckBox)sender).Checked; + txtClientCertFile.Enabled = ((CheckBox)sender).Checked; + txtClientPassPhraseFile.Enabled = ((CheckBox)sender).Checked; + txtClientPassPhrase.Enabled = ((CheckBox)sender).Checked; + } + + private void button2_Click(object sender, EventArgs e) + { + new IBConnectionStringBuilder(txtConnectionString.Text).WriteToXML("CBDemo.XML"); + } + + private void button1_Click(object sender, EventArgs e) + { + txtConnectionString.Text = ""; + IBConnectionStringBuilder ibc = new IBConnectionStringBuilder(); + ibc.ReadFromXML("CBDemo.XML"); + txtConnectionString.Text = ibc.ConnectionString; + } + } } diff --git a/NETProvider/Demos/ConnectionBuilder/ConnectionBuilder/Form1.resx b/NETProvider/Demos/ConnectionBuilder/ConnectionBuilder/Form1.resx index 1af7de1..af32865 100644 --- a/NETProvider/Demos/ConnectionBuilder/ConnectionBuilder/Form1.resx +++ b/NETProvider/Demos/ConnectionBuilder/ConnectionBuilder/Form1.resx @@ -1,17 +1,17 @@  - diff --git a/NETProvider/Demos/ConnectionBuilder/ConnectionBuilder/Properties/AssemblyInfo.cs b/NETProvider/Demos/ConnectionBuilder/ConnectionBuilder/Properties/AssemblyInfo.cs deleted file mode 100644 index adae9d6..0000000 --- a/NETProvider/Demos/ConnectionBuilder/ConnectionBuilder/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("ConnectionBuilder")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("ConnectionBuilder")] -[assembly: AssemblyCopyright("Copyright © 2021")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("ec6e1ffc-0076-4a45-b0c0-02a5ad3f85a1")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/NETProvider/Demos/ConnectionBuilder/ConnectionBuilder/Properties/Settings.Designer.cs b/NETProvider/Demos/ConnectionBuilder/ConnectionBuilder/Properties/Settings.Designer.cs index 05e083b..69a3604 100644 --- a/NETProvider/Demos/ConnectionBuilder/ConnectionBuilder/Properties/Settings.Designer.cs +++ b/NETProvider/Demos/ConnectionBuilder/ConnectionBuilder/Properties/Settings.Designer.cs @@ -8,20 +8,17 @@ // //------------------------------------------------------------------------------ - -namespace ConnectionBuilder.Properties -{ +namespace ConnectionBuilder.Properties { + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] - internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase - { - + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.8.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); - - public static Settings Default - { - get - { + + public static Settings Default { + get { return defaultInstance; } } diff --git a/NETProvider/Demos/EntityCore/EntityCoreExample.csproj b/NETProvider/Demos/EntityCore/EntityCoreExample.csproj index af7e08f..c2b1f98 100644 --- a/NETProvider/Demos/EntityCore/EntityCoreExample.csproj +++ b/NETProvider/Demos/EntityCore/EntityCoreExample.csproj @@ -2,11 +2,12 @@ Exe - netcoreapp3.1 + net6.0 + ConsoleApp3.Program - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/NETProvider/Demos/EntityCore/Model/EmployeeContext.cs b/NETProvider/Demos/EntityCore/Model/EmployeeContext.cs index 7902ba9..2fd4704 100644 --- a/NETProvider/Demos/EntityCore/Model/EmployeeContext.cs +++ b/NETProvider/Demos/EntityCore/Model/EmployeeContext.cs @@ -40,7 +40,7 @@ public override int NonQueryExecuted(DbCommand command, CommandExecutedEventData return base.NonQueryExecuted(command, eventData, result); } - public override Task NonQueryExecutedAsync(DbCommand command, CommandExecutedEventData eventData, int result, CancellationToken cancellationToken = default) + public override ValueTask NonQueryExecutedAsync(DbCommand command, CommandExecutedEventData eventData, int result, CancellationToken cancellationToken = default) { LastCommandText = command.CommandText; return base.NonQueryExecutedAsync(command, eventData, result, cancellationToken); @@ -52,7 +52,7 @@ public override DbDataReader ReaderExecuted(DbCommand command, CommandExecutedEv return base.ReaderExecuted(command, eventData, result); } - public override Task ReaderExecutedAsync(DbCommand command, CommandExecutedEventData eventData, DbDataReader result, CancellationToken cancellationToken = default) + public override ValueTask ReaderExecutedAsync(DbCommand command, CommandExecutedEventData eventData, DbDataReader result, CancellationToken cancellationToken = default) { LastCommandText = command.CommandText; return base.ReaderExecutedAsync(command, eventData, result, cancellationToken); @@ -64,7 +64,7 @@ public override object ScalarExecuted(DbCommand command, CommandExecutedEventDat return base.ScalarExecuted(command, eventData, result); } - public override Task ScalarExecutedAsync(DbCommand command, CommandExecutedEventData eventData, object result, CancellationToken cancellationToken = default) + public override ValueTask ScalarExecutedAsync(DbCommand command, CommandExecutedEventData eventData, object result, CancellationToken cancellationToken = default) { LastCommandText = command.CommandText; return base.ScalarExecutedAsync(command, eventData, result, cancellationToken); diff --git a/NETProvider/Demos/EntityCoreExample2/EFCore101.csproj b/NETProvider/Demos/EntityCoreExample2/EFCore101.csproj index 7381518..1ef26c7 100644 --- a/NETProvider/Demos/EntityCoreExample2/EFCore101.csproj +++ b/NETProvider/Demos/EntityCoreExample2/EFCore101.csproj @@ -23,8 +23,8 @@ - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/NETProvider/Demos/SimpleGrid/Properties/AssemblyInfo.cs b/NETProvider/Demos/SimpleGrid/Properties/AssemblyInfo.cs deleted file mode 100644 index d778ff6..0000000 --- a/NETProvider/Demos/SimpleGrid/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("WindowsFormsApp1")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("WindowsFormsApp1")] -[assembly: AssemblyCopyright("Copyright © 2020")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("007f6847-fa1d-45c5-9d12-84f943604ae2")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/NETProvider/Demos/SimpleGrid/SimpleDataGrid.csproj b/NETProvider/Demos/SimpleGrid/SimpleDataGrid.csproj index e07e3bb..f4b9427 100644 --- a/NETProvider/Demos/SimpleGrid/SimpleDataGrid.csproj +++ b/NETProvider/Demos/SimpleGrid/SimpleDataGrid.csproj @@ -1,87 +1,18 @@ - - - + - Debug - AnyCPU - {007F6847-FA1D-45C5-9D12-84F943604AE2} + net6.0-windows WinExe WindowsFormsApp1 WindowsFormsApp1 - v4.5.2 - 512 - true - true + false + true + true - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - False - ..\NETProvider\trunk\NETProvider\Provider\src\InterBaseSql.Data.InterBaseClient\bin\Debug\net452\InterBaseSql.Data.InterBaseClient.dll - - - - - - - - - - - - - - - - Form - - - Form1.cs - - - - - Form1.cs - - - ResXFileCodeGenerator - Resources.Designer.cs - Designer - - - True - Resources.resx - - - SettingsSingleFileGenerator - Settings.Designer.cs - - - True - Settings.settings - True - - - + + 7.14.6 + + + - \ No newline at end of file diff --git a/NETProvider/Demos/SimpleGrid/SimpleDataGrid.sln b/NETProvider/Demos/SimpleGrid/SimpleDataGrid.sln index cbf0a93..8be57a6 100644 --- a/NETProvider/Demos/SimpleGrid/SimpleDataGrid.sln +++ b/NETProvider/Demos/SimpleGrid/SimpleDataGrid.sln @@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 16 VisualStudioVersion = 16.0.30907.101 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SimpleDataGrid", "SimpleDataGrid.csproj", "{007F6847-FA1D-45C5-9D12-84F943604AE2}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SimpleDataGrid", "SimpleDataGrid.csproj", "{007F6847-FA1D-45C5-9D12-84F943604AE2}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/NETProvider/Provider/build.ps1 b/NETProvider/Provider/build.ps1 index e0aa269..e4b8540 100644 --- a/NETProvider/Provider/build.ps1 +++ b/NETProvider/Provider/build.ps1 @@ -40,11 +40,11 @@ function Build() { b 'Restore' $False b 'Restore' b 'Build' - $script:version = (Get-Item $baseDir\src\InterBaseSql.Data.InterBaseClient\bin\$Configuration\net452\InterBaseSql.Data.InterBaseClient.dll).VersionInfo.ProductVersion -replace '(\d+)\.(\d+)\.(\d+)(-[a-z0-9]+)?(.*)','$1.$2.$3$4' + $script:version = (Get-Item $baseDir\src\InterBaseSql.Data.InterBaseClient\bin\$Configuration\net6.0\InterBaseSql.Data.InterBaseClient.dll).VersionInfo.ProductVersion -replace '(\d+)\.(\d+)\.(\d+)(-[a-z0-9]+)?(.*)','$1.$2.$3$4' } function Pack() { - 7z a -mx=9 -bsp0 $outDir\InterBaseSql.Data.InterBaseClient-$version-net452.7z $baseDir\src\InterBaseSql.Data.InterBaseClient\bin\$Configuration\net452\InterBaseSql.Data.InterBaseClient.dll $baseDir\src\InterBaseSql.Data.InterBaseClient\bin\$Configuration\net452\InterBaseSql.Data.InterBaseClient.pdb +# 7z a -mx=9 -bsp0 $outDir\InterBaseSql.Data.InterBaseClient-$version-net452.7z $baseDir\src\InterBaseSql.Data.InterBaseClient\bin\$Configuration\net452\InterBaseSql.Data.InterBaseClient.dll $baseDir\src\InterBaseSql.Data.InterBaseClient\bin\$Configuration\net452\InterBaseSql.Data.InterBaseClient.pdb 7z a -mx=9 -bsp0 $outDir\InterBaseSql.Data.InterBaseClient-$version-net5.0.7z $baseDir\src\InterBaseSql.Data.InterBaseClient\bin\$Configuration\net5.0\InterBaseSql.Data.InterBaseClient.dll $baseDir\src\InterBaseSql.Data.InterBaseClient\bin\$Configuration\net5.0\InterBaseSql.Data.InterBaseClient.pdb 7z a -mx=9 -bsp0 $outDir\InterBaseSql.Data.InterBaseClient-$version-net6.0.7z $baseDir\src\InterBaseSql.Data.InterBaseClient\bin\$Configuration\net6.0\InterBaseSql.Data.InterBaseClient.dll $baseDir\src\InterBaseSql.Data.InterBaseClient\bin\$Configuration\net6.0\InterBaseSql.Data.InterBaseClient.pdb @@ -56,11 +56,11 @@ function Pack() { function NuGets() { cp $baseDir\src\InterBaseSql.Data.InterBaseClient\bin\$Configuration\InterBaseSql.Data.InterBaseClient.$version.nupkg $outDir - cp $baseDir\src\EntityFramework.InterBase\bin\$Configuration\EntityFramework.InterBase.$version.nupkg $outDir +# cp $baseDir\src\EntityFramework.InterBase\bin\$Configuration\EntityFramework.InterBase.$version.nupkg $outDir cp $baseDir\src\InterBaseSql.EntityFrameworkCore.InterBase\bin\$Configuration\InterBaseSql.EntityFrameworkCore.InterBase.$version.nupkg $outDir cp $baseDir\src\InterBaseSql.Data.InterBaseClient\bin\$Configuration\InterBaseSql.Data.InterBaseClient.$version.snupkg $outDir - cp $baseDir\src\EntityFramework.InterBase\bin\$Configuration\EntityFramework.InterBase.$version.snupkg $outDir +# cp $baseDir\src\EntityFramework.InterBase\bin\$Configuration\EntityFramework.InterBase.$version.snupkg $outDir cp $baseDir\src\InterBaseSql.EntityFrameworkCore.InterBase\bin\$Configuration\InterBaseSql.EntityFrameworkCore.InterBase.$version.snupkg $outDir } diff --git a/NETProvider/Provider/installer/Installer.wxs b/NETProvider/Provider/installer/Installer.wxs index 7baddeb..d9f7bdd 100644 --- a/NETProvider/Provider/installer/Installer.wxs +++ b/NETProvider/Provider/installer/Installer.wxs @@ -19,6 +19,7 @@ + @@ -33,12 +34,12 @@ - + - + @@ -65,7 +66,6 @@ - @@ -84,7 +84,6 @@ - @@ -118,7 +117,6 @@ - @@ -166,11 +164,18 @@ + + + + + + + - + diff --git a/NETProvider/Provider/src/Directory.Build.props b/NETProvider/Provider/src/Directory.Build.props index 26affcb..c5e15f5 100644 --- a/NETProvider/Provider/src/Directory.Build.props +++ b/NETProvider/Provider/src/Directory.Build.props @@ -5,7 +5,7 @@ portable - 7.13.7 + 7.14.6 Embarcadero NETProvider diff --git a/NETProvider/Provider/src/EntityFramework.InterBase.Tests/EntityFramework.InterBase.Tests.csproj b/NETProvider/Provider/src/EntityFramework.InterBase.Tests/EntityFramework.InterBase.Tests.csproj index 90275da..bbf3f23 100644 --- a/NETProvider/Provider/src/EntityFramework.InterBase.Tests/EntityFramework.InterBase.Tests.csproj +++ b/NETProvider/Provider/src/EntityFramework.InterBase.Tests/EntityFramework.InterBase.Tests.csproj @@ -1,6 +1,6 @@  - net5.0 + net5.0;net6.0 false false true @@ -22,6 +22,7 @@ + diff --git a/NETProvider/Provider/src/EntityFramework.InterBase/EntityFramework.InterBase.csproj b/NETProvider/Provider/src/EntityFramework.InterBase/EntityFramework.InterBase.csproj index d99c897..95aa45a 100644 --- a/NETProvider/Provider/src/EntityFramework.InterBase/EntityFramework.InterBase.csproj +++ b/NETProvider/Provider/src/EntityFramework.InterBase/EntityFramework.InterBase.csproj @@ -1,6 +1,6 @@  - net452;netstandard2.1 + net50;net60 EntityFramework.InterBase EntityFramework.InterBase true diff --git a/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient.Tests/IBArrayTests.cs b/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient.Tests/IBArrayTests.cs index 719a3ac..6a160b2 100644 --- a/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient.Tests/IBArrayTests.cs +++ b/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient.Tests/IBArrayTests.cs @@ -241,7 +241,7 @@ public void DoubleArrayTest() } [Test] - public void NumericArrayTest() + public virtual void NumericArrayTest() { Transaction = Connection.BeginTransaction(); @@ -580,7 +580,7 @@ public void DoubleArrayPartialUpdateTest() } [Test] - public void NumericArrayPartialUpdateTest() + public virtual void NumericArrayPartialUpdateTest() { var updateText = "update TEST set narray_field = @array_field " + "WHERE int_field = 1"; diff --git a/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient.Tests/IBCommandTests.cs b/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient.Tests/IBCommandTests.cs index 773570a..a11ce9a 100644 --- a/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient.Tests/IBCommandTests.cs +++ b/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient.Tests/IBCommandTests.cs @@ -666,7 +666,7 @@ public void ReadingCharOctetsTest() { if (reader.Read()) { - read = (byte[])reader[0]; + read = System.Text.Encoding.ASCII.GetBytes((string)reader[0]); } } diff --git a/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient.Tests/IBConnectionTests.cs b/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient.Tests/IBConnectionTests.cs index 2f9e91a..b5dd4e1 100644 --- a/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient.Tests/IBConnectionTests.cs +++ b/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient.Tests/IBConnectionTests.cs @@ -340,9 +340,8 @@ private int GetLogRowsCount(IBConnection conn) return Convert.ToInt32(cmd.ExecuteScalar()); } } - + // Dialect 1 client to a Dialect 3 database should not accept this as per Sriram [Test] - [TestCase(1)] [TestCase(3)] public void DialectAndDATE(int dialect) { diff --git a/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient.Tests/IBDataReaderTests.cs b/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient.Tests/IBDataReaderTests.cs index a0a028a..880176f 100644 --- a/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient.Tests/IBDataReaderTests.cs +++ b/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient.Tests/IBDataReaderTests.cs @@ -311,9 +311,9 @@ public virtual void ValidateDecimalSchema() r.Close(); // Check schema values - Assert.AreEqual(schema.Rows[0]["ColumnSize"], 8, "Invalid length"); - Assert.AreEqual(schema.Rows[0]["NumericPrecision"], 15, "Invalid precision"); - Assert.AreEqual(schema.Rows[0]["NumericScale"], 2, "Invalid scale"); + Assert.AreEqual(8, schema.Rows[0]["ColumnSize"], "Invalid length"); + Assert.AreEqual(15, schema.Rows[0]["NumericPrecision"], "Invalid precision"); + Assert.AreEqual(2, schema.Rows[0]["NumericScale"], "Invalid scale"); } [Test] @@ -565,23 +565,5 @@ public override void GetOrdinalTest() transaction.Rollback(); command.Dispose(); } - - [Test] - public override void ValidateDecimalSchema() - { - var sql = "select decimal_field from test"; - - var test = new IBCommand(sql, Connection); - var r = test.ExecuteReader(CommandBehavior.SchemaOnly); - - var schema = r.GetSchemaTable(); - - r.Close(); - - // Check schema values - Assert.AreEqual(schema.Rows[0]["ColumnSize"], 8, "Invalid length"); - Assert.AreEqual(schema.Rows[0]["NumericPrecision"], 8, "Invalid precision"); - Assert.AreEqual(schema.Rows[0]["NumericScale"], 2, "Invalid scale"); - } } } diff --git a/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient.Tests/IBServicesTests.cs b/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient.Tests/IBServicesTests.cs index ccb07d4..beba694 100644 --- a/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient.Tests/IBServicesTests.cs +++ b/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient.Tests/IBServicesTests.cs @@ -64,7 +64,8 @@ public override void SetUp() [Test] public void BackupRestoreTest() { -// var path = System.IO.Path.GetDirectoryName(Assembly.GetEntryAssembly().Location); + // var path = System.IO.Path.GetDirectoryName(Assembly.GetEntryAssembly().Location); + System.Threading.Thread.Sleep(2000); // timing issue from last test so let sever finish things before doign this one var path = AppDomain.CurrentDomain.BaseDirectory; var backupName = $"{path}{Guid.NewGuid().ToString()}.bak"; void BackupPart() @@ -95,6 +96,7 @@ void RestorePart() restoreSvc.Execute(); } BackupPart(); + Thread.Sleep(2000); RestorePart(); // test the database was actually restored fine Connection.Open(); diff --git a/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient.Tests/InterBaseSql.Data.InterBaseClient.Tests.csproj b/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient.Tests/InterBaseSql.Data.InterBaseClient.Tests.csproj index d4551da..0e1101f 100644 --- a/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient.Tests/InterBaseSql.Data.InterBaseClient.Tests.csproj +++ b/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient.Tests/InterBaseSql.Data.InterBaseClient.Tests.csproj @@ -1,6 +1,6 @@  - net452;netcoreapp3.1;net50;net60 + netcoreapp3.1;net50;net60 false false true diff --git a/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Client/Native/Changelog.md b/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Client/Native/Changelog.md index e5270ab..ab4c61a 100644 --- a/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Client/Native/Changelog.md +++ b/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Client/Native/Changelog.md @@ -1,7 +1,31 @@ +# Changes for 7.14.5 + +## IBClientFactory.cs +* Fixed how MacOS was determined. Requires .NET 5.0 or higher to work. + +## LinuxClient.cs +* Added Virtual function LibCryptName to return the name of the libcrypt.so. Overridden in MacOSClient +* LoadIBLibrary now uses the new function to get the string vs the old hard-coded string +* TryGetProcAddess promoted from private to protected and made virtual (so MacOSClient can override) + +## MacOSClient.cs +* Fixed misspelling of dylib in the two importing dll names. +* Override LibCryptName with the Mac crypto dylib +* Override TryGetProcAddess to use the MacUnsafeNativeMethods loading methods. + +# Changes for 7.14.0 + +## IBArray.cs +* Added passing the Dialect to GetDbDataTypeFromBlrType for better dialect 1 support. +* Fixed up parameters passed in Marshalling routins and Descriptor creations as they changed for better Dialect 1 support. + +## IBStatement.pas +* Descriptor now expects the database password for better Dialect 1 support + # Changes for 7.13.6 ## IBArray.cs -^ Added support for sql_double +* Added support for sql_double # Changes for 7.12.1 diff --git a/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Client/Native/Changelog.txt b/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Client/Native/Changelog.txt deleted file mode 100644 index 3d59be5..0000000 --- a/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Client/Native/Changelog.txt +++ /dev/null @@ -1,161 +0,0 @@ -Changes for 7.10.2 - - General - - - To support the posix versions of the native IB client DLLs the whole injection scheme was removed due to not being able to support cdecl calling convention (and there are 3 or 4 windows dll's that use cdecl around events that their native driver suppport did not support). The current code always injected stdcall as the calling convention and .NET 4.52 does not support the cdecl calling convention. At this time it was decided to not support a managed interface to IB and only go through the supplied native clients. - - All class names and name spaces are changed to be IB vs Fb or Fes. This was done so that both the Fb driver and this driver it is based on will not have any naming conflicts if both used in the same application. - - Common - Namespaces changed from FirebirdSql.Data.Client.Native to InterBaseSql.Data.Client.Native - Uses InterBaseSql.Data.Common instead of FirebirdSql.Data.Common - Use the IB named versions of classes and variable names where appropriate moved from fb to ib prefixes. - - FbClientFactory.cs renamed to IBClientFactory.cs - IBClientFactory total rewrite to support cdecl calling convention on POSIX platforms. - Added Register(string id) to register each of the IIBClient class implementors - GetGDSLibrary returns a shared instance to the explicit IIClient for the running platform with the passed Server type. Naming convention is expected to be So windows default class name would be WindowsClient. Linux Embedded would be LinuxEmbedded. In each case you would pass Client or Embedded as ServerType and the routine figures out the platform. - - FesArray.cs renamed to IBArray.cs - FesArray class renamed to IBArray - General change of Firebird class and variable names to the IB Equivalent - GetSlice - Supports Array descriptor V2 when connected to a client version >= 7.0 and calls isc_array_get_slice2 in that case - PutSlice - Supports Array descriptor V2 when connected to a client version >= 7.0 and calls isc_array_put_slice2 in that case - - FesBlob.cs renamed to IBBlob.cs - FesBlob class renamed to IBBlob - General fixup of Firebird class and variable names to the IB Equivalent - - FesConnection.cs renamed to IBConnection.cs - FesConnection class renamed to IBConnection - General fixup of Firebird class and variable names to the IB Equivalent - ParseStatusVector removed IscCodes.isc_arg_sql_state section - - FesDatabase.cs renamed to IBDatabase.cs - FesDatabase class renamed to IBDatabase (general note - Over the Wire encryption is done differently between Fb and IB. With IB it is part of the connection string) - CreateDatabaseWithTrustedAuth removed - CreateDatabase removed crypto key support - Attach removed crypto key suppport - AttachWithTrustedAuth removed - CancelOperation basically is no op'ed until the Async code is updated. (fb version worked with their managed code) - DatabaseParameterBufferBase basically removed and just DatabaseParameterBuffer used where approperiate - GetServerVersion uses isc_info_version in the call to GetDatabaseinfo - CheckCryptKeyForSupport removed - - FesServiceManager.cs renamed to IBServiceManager.cs (general note - Over the Wire encryption is done differently between Fb and IB. With IB it is part of the connection string) - FesServiceManager class renamed to IBServiceManager - IBServiceManager constructor expects a IBServerType as the first parameter to determine default or embedded client - Attach removed crypto support - - FesStatement.cs renamed to IBStatement.cs - FesStatement class renamed to IBStatement - Execute - Call to isc_dsql_execute2 now passes the current SQLDAVersion - Fetch - Call to isc_dsql_fetch now passes the current SQLDAVersion - DescribeParameters - passes IscCodes.SQLDA_CURRENT_VERSION to isc_dsql_describe_bind - Allocate now calls isc_dsql_alloc_statement2 instead of isc_dsql_alloc_statement - - FesTransaction.cs renamed to IBTransaction.cs - FesTransaction class renamed to IBTransaction - Fixed up some constant strings to reference InterBase instead of Firebird. - BeginTransaction - fixed a pointer size bug in the Fb code. Original code assumes pointers are always 4 bytes. - Added StartSavepoint - Added RollbackSavepoint - Added ReleaseSavepoint - - IfbClient.cs renamed to IIBClient.cs - IFbClient interface renamed to IIBClient - added string LibraryName(); - added void LoadIBLibrary(); - added void FreeIBLibrary(); - added bool TryIBLoad(); - added void CheckIBLoaded(); - added string Platform { get; } - added string ServerType(); - added decimal IBClientVersion { get; } - added short SQLDAVersion { get; } - removed fb_shutdown - removed fb_cancel_operation - removed isc_dsql_allocate_statement - added isc_array_gen_sdl - added isc_array_gen_sdl2 - added isc_array_get_slice2 - added isc_array_lookup_bounds - added isc_array_lookup_bounds2 - added isc_array_lookup_desc - added isc_array_lookup_desc2 - added isc_array_set_desc - added isc_array_set_desc2 - added isc_array_put_slice2 - added isc_blob_default_desc - added isc_blob_default_desc2 - added isc_blob_gen_bpb - added isc_blob_gen_bpb2 - added isc_blob_info - added isc_blob_lookup_desc - added isc_blob_lookup_desc2 - added isc_blob_set_desc - added isc_blob_set_desc2 - added isc_cancel_events - added isc_decode_date - added isc_decode_sql_date - added isc_decode_sql_time - added isc_decode_timestamp - added isc_dsql_alloc_statement2 - added isc_dsql_exec_immed2 - added isc_dsql_batch_execute_immed - added isc_dsql_batch_execute - added isc_dsql_execute_immediate - added isc_dsql_set_cursor_name - added isc_encode_date - added isc_encode_sql_date - added isc_encode_sql_time - added isc_encode_timestamp - added isc_event_block - added isc_event_counts - added isc_free - added isc_get_segment - added isc_interprete - added isc_prepare_transaction - added isc_prepare_transaction2 - added isc_que_events - added isc_release_savepoint - added isc_rollback_savepoint - added isc_start_savepoint - added isc_start_transaction - added isc_sqlcode - added isc_sql_interprete - added isc_transaction_info - added isc_vax_integer - added isc_portable_integer - added isc_get_client_version - added isc_get_client_major_version - added isc_get_client_minor_version - - LinuxClient.cs - new - class LinuxClient implements IIBClient for Linux. Since this is a POSIX system all calling conventions in the DLL are cdecl. - - LinuxEmbedded.cs - new - Inherits from LinuxClient - Overrides the LibraryName method to return the embedded client .so name - Overrides the ServerType method to return Embedded. - - MacOSClient.cs - new - Inherits from LinuxClient - Overrides the LibraryName method to return the embedded client .dynlib name - Overrides Platform to return MacOS - Overrides GetProcAddress and LoadLibrary to use the MacOS libdl.dynlib versions - - MacOSEmbedded.cs - new - Inherits from MacOSClient - Overrides the LibraryName method to return the embedded client .dynlib name - Overrides the ServerType method to return Embedded. - - WindowsClient.cs - new - class WindowsClient implements IIBClient for Windows. Almost all calls are stdcall callign conventions, but a few are cdecl. - - WindowsEmbedded.cs - new - Inherits from WindowsClient - Overrides the LibraryName method to return the embedded client .dll name based on 32/64 bit environment - Overrides the ServerType method to return Embedded. - - \ No newline at end of file diff --git a/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Client/Native/IBArray.cs b/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Client/Native/IBArray.cs index 9d99220..7fd437f 100644 --- a/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Client/Native/IBArray.cs +++ b/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Client/Native/IBArray.cs @@ -243,7 +243,7 @@ protected override Array DecodeSlice(byte[] slice) var tempData = Array.CreateInstance(systemType, sliceData.Length); type = TypeHelper.GetSqlTypeFromBlrType(Descriptor.DataType); - dbType = TypeHelper.GetDbDataTypeFromBlrType(Descriptor.DataType, 0, Descriptor.Scale); + dbType = TypeHelper.GetDbDataTypeFromBlrType(Descriptor.DataType, 0, Descriptor.Scale, _db.Dialect); int itemLength = Descriptor.Length; @@ -392,7 +392,7 @@ private byte[] EncodeSlice(ArrayDesc desc, Array sourceArray, int length) var type = 0; type = TypeHelper.GetSqlTypeFromBlrType(Descriptor.DataType); - dbType = TypeHelper.GetDbDataTypeFromBlrType(Descriptor.DataType, subType, Descriptor.Scale); + dbType = TypeHelper.GetDbDataTypeFromBlrType(Descriptor.DataType, subType, Descriptor.Scale, _db.Dialect); foreach (var source in sourceArray) { diff --git a/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Client/Native/IBClientFactory.cs b/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Client/Native/IBClientFactory.cs index f8ed90b..8fa46ab 100644 --- a/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Client/Native/IBClientFactory.cs +++ b/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Client/Native/IBClientFactory.cs @@ -25,6 +25,7 @@ using InterBaseSql.Data.InterBaseClient; using InterBaseSql.Data.Client.Native.Handle; using InterBaseSql.Data.Common; +using System.Runtime.InteropServices; namespace InterBaseSql.Data.Client.Native { @@ -50,7 +51,14 @@ public void Register(string id) public static IIBClient GetGDSLibrary(IBServerType id) { Type type; - string Platform; + string Platform = "Windows"; + +#if NET5_0_OR_GREATER + if (System.Runtime.InteropServices.RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) + Platform = "Linux"; + if (System.Runtime.InteropServices.RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) + Platform = "MacOS"; +#else switch (Environment.OSVersion.Platform) { case PlatformID.Win32S: @@ -67,6 +75,8 @@ public static IIBClient GetGDSLibrary(IBServerType id) default: throw new Exception("Unsupported OS"); } +#endif + Platform += id.ToString(); diff --git a/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Client/Native/IBStatement.cs b/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Client/Native/IBStatement.cs index 421679c..0decad1 100644 --- a/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Client/Native/IBStatement.cs +++ b/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Client/Native/IBStatement.cs @@ -210,9 +210,9 @@ public override void Prepare(string commandText) Allocate(); } - _fields = new Descriptor(1); + _fields = new Descriptor(_db, 1); - var sqlda = XsqldaMarshaler.MarshalManagedToNative(_db.Charset, _fields); + var sqlda = XsqldaMarshaler.MarshalManagedToNative(_fields); var trHandle = _transaction.HandlePtr; var buffer = _db.Charset.GetBytes(commandText); @@ -226,7 +226,7 @@ public override void Prepare(string commandText) _db.Dialect, sqlda); - var descriptor = XsqldaMarshaler.MarshalNativeToManaged(_db.Charset, sqlda); + var descriptor = XsqldaMarshaler.MarshalNativeToManaged(_db, sqlda); XsqldaMarshaler.CleanUpNativeData(ref sqlda); @@ -242,7 +242,7 @@ public override void Prepare(string commandText) { if (_fields.ActualCount == 0) { - _fields = new Descriptor(0); + _fields = new Descriptor(_db, 0); } } @@ -267,12 +267,12 @@ public override void Execute() if (_parameters != null) { - inSqlda = XsqldaMarshaler.MarshalManagedToNative(_db.Charset, _parameters); + inSqlda = XsqldaMarshaler.MarshalManagedToNative(_parameters); } if (StatementType == DbStatementType.StoredProcedure) { Fields.ResetValues(); - outSqlda = XsqldaMarshaler.MarshalManagedToNative(_db.Charset, _fields); + outSqlda = XsqldaMarshaler.MarshalManagedToNative(_fields); } var trHandle = _transaction.HandlePtr; @@ -287,7 +287,7 @@ public override void Execute() if (outSqlda != IntPtr.Zero) { - var descriptor = XsqldaMarshaler.MarshalNativeToManaged(_db.Charset, outSqlda, true); + var descriptor = XsqldaMarshaler.MarshalNativeToManaged(_db, outSqlda, true); var values = new DbValue[descriptor.Count]; @@ -344,14 +344,14 @@ public override DbValue[] Fetch() if (_fetchSqlDa == IntPtr.Zero) { - _fetchSqlDa = XsqldaMarshaler.MarshalManagedToNative(_db.Charset, _fields); + _fetchSqlDa = XsqldaMarshaler.MarshalManagedToNative(_fields); } ClearStatusVector(); var status = _db.IBClient.isc_dsql_fetch(_statusVector, ref _handle, IscCodes.SQLDA_CURRENT_VERSION, _fetchSqlDa); - var rowDesc = XsqldaMarshaler.MarshalNativeToManaged(_db.Charset, _fetchSqlDa, true); + var rowDesc = XsqldaMarshaler.MarshalNativeToManaged(_db, _fetchSqlDa, true); if (_fields.Count == rowDesc.Count) { @@ -401,9 +401,9 @@ public override void Describe() { ClearStatusVector(); - _fields = new Descriptor(_fields.ActualCount); + _fields = new Descriptor(_db, _fields.ActualCount); - var sqlda = XsqldaMarshaler.MarshalManagedToNative(_db.Charset, _fields); + var sqlda = XsqldaMarshaler.MarshalManagedToNative(_fields); _db.IBClient.isc_dsql_describe( @@ -412,7 +412,7 @@ public override void Describe() IscCodes.SQLDA_VERSION1, sqlda); - var descriptor = XsqldaMarshaler.MarshalNativeToManaged(_db.Charset, sqlda); + var descriptor = XsqldaMarshaler.MarshalNativeToManaged(_db, sqlda); XsqldaMarshaler.CleanUpNativeData(ref sqlda); @@ -425,9 +425,9 @@ public override void DescribeParameters() { ClearStatusVector(); - _parameters = new Descriptor(1); + _parameters = new Descriptor(_db, 1); - var sqlda = XsqldaMarshaler.MarshalManagedToNative(_db.Charset, _parameters); + var sqlda = XsqldaMarshaler.MarshalManagedToNative(_parameters); _db.IBClient.isc_dsql_describe_bind( @@ -436,18 +436,18 @@ public override void DescribeParameters() IscCodes.SQLDA_CURRENT_VERSION, sqlda); - var descriptor = XsqldaMarshaler.MarshalNativeToManaged(_db.Charset, sqlda); + var descriptor = XsqldaMarshaler.MarshalNativeToManaged(_db, sqlda); _db.ProcessStatusVector(_statusVector); if (descriptor.ActualCount != 0 && descriptor.Count != descriptor.ActualCount) { var n = descriptor.ActualCount; - descriptor = new Descriptor(n); + descriptor = new Descriptor(_db, n); XsqldaMarshaler.CleanUpNativeData(ref sqlda); - sqlda = XsqldaMarshaler.MarshalManagedToNative(_db.Charset, descriptor); + sqlda = XsqldaMarshaler.MarshalManagedToNative(descriptor); _db.IBClient.isc_dsql_describe_bind( _statusVector, @@ -455,7 +455,7 @@ public override void DescribeParameters() IscCodes.SQLDA_CURRENT_VERSION, sqlda); - descriptor = XsqldaMarshaler.MarshalNativeToManaged(_db.Charset, sqlda); + descriptor = XsqldaMarshaler.MarshalNativeToManaged(_db, sqlda); XsqldaMarshaler.CleanUpNativeData(ref sqlda); @@ -465,7 +465,7 @@ public override void DescribeParameters() { if (descriptor.ActualCount == 0) { - descriptor = new Descriptor(0); + descriptor = new Descriptor(_db, 0); } } diff --git a/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Client/Native/LinuxClient.cs b/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Client/Native/LinuxClient.cs index 4aa4b1c..29145bf 100644 --- a/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Client/Native/LinuxClient.cs +++ b/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Client/Native/LinuxClient.cs @@ -42,6 +42,7 @@ internal static class LinuxUnsafeNativeMethods class LinuxClient : IIBClient { + #region FunctionDefinitions [UnmanagedFunctionPointer(CallingConvention.Cdecl)] internal delegate void Tisc_get_client_version(byte[] buffer); [UnmanagedFunctionPointer(CallingConvention.Cdecl)] @@ -641,7 +642,7 @@ internal delegate IntPtr Tisc_dsql_batch_execute( Tisc_start_savepoint _isc_start_savepoint; Tisc_dsql_batch_execute_immed _isc_dsql_batch_execute_immed; Tisc_dsql_batch_execute _isc_dsql_batch_execute; - + #endregion public LinuxClient() { @@ -662,7 +663,12 @@ public virtual string LibraryName() return "libgds.so" ; } - private IntPtr TryGetProcAddess(string ProcName) + public virtual string LibCryptName() + { + return "libcrypt.so"; + } + + protected virtual IntPtr TryGetProcAddess(string ProcName) { return LinuxUnsafeNativeMethods.dlsym(FIBLibrary, ProcName); } @@ -684,7 +690,7 @@ protected virtual IntPtr LoadLibrary(string libName) public void LoadIBLibrary() { FIBLibrary = LoadLibrary(LibraryName()); - FIBCrypt = LoadLibrary("libcrypt.so"); + FIBCrypt = LoadLibrary(LibCryptName()); if (FIBLibrary != IntPtr.Zero) { _isc_sqlcode = (Tisc_sqlcode)Marshal.GetDelegateForFunctionPointer(GetProcAddress("isc_sqlcode"), typeof(Tisc_sqlcode)); @@ -754,12 +760,13 @@ public void LoadIBLibrary() _isc_encode_timestamp = (Tisc_encode_timestamp)Marshal.GetDelegateForFunctionPointer(GetProcAddress("isc_encode_timestamp"), typeof(Tisc_encode_timestamp)); - //FBLOB_get := GetProcAddr('BLOB_get'); {do not localize} - //FBLOB_put := GetProcAddr('BLOB_put'); {do not localize} + //FBLOB_get := GetProcAddr('BLOB_get'); + //FBLOB_put := GetProcAddr('BLOB_put'); + + //_isc_add_user := (Tisc_add_user)Marshal.GetDelegateForFunctionPointer(GetProcAddress('isc_add_user')); + //_isc_delete_user := (Tisc_delete_user)Marshal.GetDelegateForFunctionPointer('isc_delete_user')); + //_isc_modify_user := (Tisc_modify_user)Marshal.GetDelegateForFunctionPointer('isc_modify_user')); - //Fisc_add_user := GetProcAddr('isc_add_user'); {do not localize} - //Fisc_delete_user := GetProcAddr('isc_delete_user'); {do not localize} - //Fisc_modify_user := GetProcAddr('isc_modify_user'); {do not localize} IBClientVersion = 6; SQLDAVersion = IscCodes.SQLDA_VERSION1; if (TryGetProcAddess("isc_get_client_version") != IntPtr.Zero) diff --git a/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Client/Native/MacOSClient.cs b/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Client/Native/MacOSClient.cs index 840ad95..034d2e2 100644 --- a/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Client/Native/MacOSClient.cs +++ b/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Client/Native/MacOSClient.cs @@ -25,11 +25,11 @@ namespace InterBaseSql.Data.Client.Native { internal static class MacUnsafeNativeMethods { - [DllImport("libdl.dynlib")] + [DllImport("libdl.dylib")] #pragma warning disable IDE1006 // Naming Styles internal static extern IntPtr dlopen(string filename, int flags); - [DllImport("libdl.dynlib")] + [DllImport("libdl.dylib")] internal static extern IntPtr dlsym(IntPtr handle, string symbol); #pragma warning restore IDE1006 // Naming Styles @@ -44,6 +44,15 @@ public override string LibraryName() { return "libgds.dylib"; } + public override string LibCryptName() + { + return "libcrypt.dylib"; + } + + protected override IntPtr TryGetProcAddess(string ProcName) + { + return MacUnsafeNativeMethods.dlsym(FIBLibrary, ProcName); + } protected override IntPtr GetProcAddress(string ProcName) { diff --git a/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Client/Native/Marshalers/Changelog.md b/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Client/Native/Marshalers/Changelog.md new file mode 100644 index 0000000..a8d3bec --- /dev/null +++ b/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Client/Native/Marshalers/Changelog.md @@ -0,0 +1,52 @@ +# Changes for 7.14.0 + +## XsqldaMarsher.cs +* Added passing the CharSet and DB to some procedures to better support Dialect 1 + +# Changes for 7.10.2 + +## General - +* All classnames and namespaces are changed to be IB vs FB or Fes. This was done so that both the FB driver this driver is based on and this one will not have any naming conflict if both used in the same application. + +## Common +* Namespace changed from FirebirdSql.Data.Client.Native.Marshalers to InterBaseSql.Data.Client.Native.Marshalers +* Uses InterBaseSql.Data.Common instead of FirebirdSql.Data.Common +* In general all SQLDA/SQLVar code now defaults to V2 with specific V1 versions re-added where needed. + +## Added ArrayDescMarshal_V2.cs For support of the V2 array descriptor + +## ArrayDescMarshaler.cs +* added CleanUpNativeData2 to clean up the Native V2 of arrays +* added MarshalManagedToNative2 to Marshal between a V2 Array structure and the Array Descriptor +* added MarshalManagedToNative overload for the new ArrayDescMarshal_V2 type + +## Added CTimeStructure.cs to work with hte CTimeStructue of hte interbase DateTime API calls. + +## Added JaggedArrayMarshaler.cs for API support of Events. + +## XsqldaMarshaler.cs (Generally added V2 suppport as primary with the old V1 versions getting renamed with V1 in their naming structure) +* Added support of both V1 and V2 of XSQLDA structure. +* Added V2 support to CleanUpNativeData +* Added V2 support to MarshalManagedToNative +* MarshalManagedToNative renamed to MarshalManagedToNative_V1 +* Added new MarshalManagedToNative that supports V2 +* Renamed MarshalXSQLVARNativeToManaged to MarshalXSQLVARV1NativeToManaged +* Added new MarshalXSQLVARNativeToManaged that supports V2 +* Added V2 support ofr XSQLDA to MarshalNativeToManaged +* MarshalXSQLVARNativeToManaged changed signature for V1 version of XSQLVAR +* Added overloaded MarshalXSQLVARNativeToManaged for V2 version of XSQLVar +* ComputeLength supports both V1 and V2 versions of XSQLVar and params now include a version parameter +* GetBytes removed Firebird specific datatype and changed signature to support V1 version of XSQLVar +* Added overloaded GetBytes to support V2 od XSQLVar +* GetStringBuffer now used for V2 and the Stringbuffer returned is 68 bytes +* Added (renamed) GetStringBuffer_V1 which is hte old 32 byte string buffer routine used with V1 structures + +## XSQLVAR.cs +* Semantically changed from representing a V1 version of hte XSQLVar to the V2 (IB surrent) +* Added sqlprecision field +* Sizes of the byte arrays increased from 32 to 68 + +## XSQLVAR_V1.cs It the old XSQLVAR.cs renamed. + + + diff --git a/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Client/Native/Marshalers/Changelog.txt b/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Client/Native/Marshalers/Changelog.txt deleted file mode 100644 index 69f03e0..0000000 --- a/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Client/Native/Marshalers/Changelog.txt +++ /dev/null @@ -1,47 +0,0 @@ -Changes for 7.10.2 - - General - - All classnames and namespaces are changed to be IB vs FB or Fes. This was done so that both the FB driver this driver is based on and this one will not have any naming conflict if both used in the same application. - - Common - Namespace changed from FirebirdSql.Data.Client.Native.Marshalers to InterBaseSql.Data.Client.Native.Marshalers - Uses InterBaseSql.Data.Common instead of FirebirdSql.Data.Common - In general all SQLDA/SQLVar code now defaults to V2 with specific V1 versions re-added where needed. - - Added ArrayDescMarshal_V2.cs For support of the V2 array descriptor - - ArrayDescMarshaler.cs - added CleanUpNativeData2 to clean up the Native V2 of arrays - added MarshalManagedToNative2 to Marshal between a V2 Array structure and the Array Descriptor - added MarshalManagedToNative overload for the new ArrayDescMarshal_V2 type - - Added CTimeStructure.cs to work with hte CTimeStructue of hte interbase DateTime API calls. - - Added JaggedArrayMarshaler.cs for API support of Events. - - XsqldaMarshaler.cs (Generally added V2 suppport as primary with the old V1 versions getting renamed with V1 in their naming structure) - Added support of both V1 and V2 of XSQLDA structure. - Added V2 support to CleanUpNativeData - Added V2 support to MarshalManagedToNative - MarshalManagedToNative renamed to MarshalManagedToNative_V1 - Added new MarshalManagedToNative that supports V2 - Renamed MarshalXSQLVARNativeToManaged to MarshalXSQLVARV1NativeToManaged - Added new MarshalXSQLVARNativeToManaged that supports V2 - Added V2 support ofr XSQLDA to MarshalNativeToManaged - MarshalXSQLVARNativeToManaged changed signature for V1 version of XSQLVAR - Added overloaded MarshalXSQLVARNativeToManaged for V2 version of XSQLVar - ComputeLength supports both V1 and V2 versions of XSQLVar and params now include a version parameter - GetBytes removed Firebird specific datatype and changed signature to support V1 version of XSQLVar - Added overloaded GetBytes to support V2 od XSQLVar - GetStringBuffer now used for V2 and the Stringbuffer returned is 68 bytes - Added (renamed) GetStringBuffer_V1 which is hte old 32 byte string buffer routine used with V1 structures - - XSQLVAR.cs - Semantically changed from representing a V1 version of hte XSQLVar to the V2 (IB surrent) - Added sqlprecision field - Sizes of the byte arrays increased from 32 to 68 - - XSQLVAR_V1.cs It the old XSQLVAR.cs renamed. - - - \ No newline at end of file diff --git a/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Client/Native/Marshalers/XsqldaMarshaler.cs b/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Client/Native/Marshalers/XsqldaMarshaler.cs index b46444f..d860f1f 100644 --- a/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Client/Native/Marshalers/XsqldaMarshaler.cs +++ b/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Client/Native/Marshalers/XsqldaMarshaler.cs @@ -80,8 +80,9 @@ public static void CleanUpNativeData(ref IntPtr pNativeData) } } - public static IntPtr MarshalManagedToNative(Charset charset, Descriptor descriptor) + public static IntPtr MarshalManagedToNative(Descriptor descriptor) { + var charset = descriptor.Database.Charset; var xsqlda = new XSQLDA { version = descriptor.Version, @@ -199,9 +200,9 @@ public static IntPtr MarshalManagedToNative_V1(XSQLDA xsqlda, XSQLVAR_V1[] xsqlv return ptr; } - public static Descriptor MarshalNativeToManaged(Charset charset, IntPtr pNativeData) + public static Descriptor MarshalNativeToManaged(IBDatabase db, IntPtr pNativeData) { - return MarshalNativeToManaged(charset, pNativeData, false); + return MarshalNativeToManaged(db, pNativeData, false); } private static void MarshalNativeSQLVarV1ToManaged(Descriptor descriptor, Charset charset, IntPtr pNativeData, bool fetching) @@ -269,11 +270,13 @@ private static void MarshalNativeSQLVarToManaged(Descriptor descriptor, Charset } } - public static Descriptor MarshalNativeToManaged(Charset charset, IntPtr pNativeData, bool fetching) + public static Descriptor MarshalNativeToManaged(IBDatabase db, IntPtr pNativeData, bool fetching) { + var charset = db.Charset; + var xsqlda = Marshal.PtrToStructure(pNativeData); - var descriptor = new Descriptor(xsqlda.sqln) { ActualCount = xsqlda.sqld, Version = xsqlda.version}; + var descriptor = new Descriptor(db, xsqlda.sqln) { ActualCount = xsqlda.sqld, Version = xsqlda.version}; if (xsqlda.version == IscCodes.SQLDA_VERSION2) { diff --git a/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Common/ArrayBase.cs b/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Common/ArrayBase.cs index f8fb45e..09a19e0 100644 --- a/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Common/ArrayBase.cs +++ b/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Common/ArrayBase.cs @@ -173,7 +173,7 @@ protected int GetSliceLength(bool read) protected Type GetSystemType() { - return TypeHelper.GetTypeFromBlrType(_descriptor.DataType, default, _descriptor.Scale); + return TypeHelper.GetTypeFromBlrType(_descriptor.DataType, default, _descriptor.Scale, Database.Dialect); } #endregion diff --git a/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Common/Changelog.md b/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Common/Changelog.md index 86bdd5f..e7bfdcf 100644 --- a/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Common/Changelog.md +++ b/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Common/Changelog.md @@ -1,10 +1,38 @@ +# Changes for 7.14.0 + +## ArrayBase.cs +* TypeHelper now requires the Dialect to be passed + +## Charset.cs +* Additional Encodings now supported. It will try to load System.Text.Encoding.CodePages.dll, If successful ANSI Code pages are now supported (like SJIS) +* If the charset is none on a column, first tries to encode in the current ANSI CodePage, if that fails, falls back to the Default Encoding (UTF8) + +## DbField.cs +* Now keeps a reference to the IDatabase Object +* New property Database that access the IDatabase reference +* TypeHelper.GetDbDataTypeFromSqlType now needs the dialect passed +* constructor now has an IDatabase parameter + +## DbValue.cs +* Added a Dialect read only property that returns the Dialect for the connection the DbValue uses. +* GetValue now included DbDataType.Char + +## Descriptor.cs +* Now has an IDatabase property +* Constructor requires a IDatabase parameter now + +## TypeHelper.cs +* GetTypeFromBlrType and GetDbDataTypeFromBlrType now requires the dialect to be passed +* GetDbDataTypeFromSqlType now has an optional Dialect parameter that defaults to 3 +* GetDbDataTypeFromSqlType SQL_D_FLOAT when Dialect 1 returns DbDataType.Double + # Changes for 7.13.6 ## IscHelper.cs -^ Added support for IscCodes.isc_info_db_sql_dialect +* Added support for IscCodes.isc_info_db_sql_dialect ## TypeHelper.cs -^ Changed BigInt to Numeric(18,0) +* Changed BigInt to Numeric(18,0) # Changes for 7.12.1 diff --git a/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Common/Charset.cs b/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Common/Charset.cs index dd65ef1..af3ef11 100644 --- a/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Common/Charset.cs +++ b/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Common/Charset.cs @@ -21,6 +21,8 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Linq.Expressions; +using System.Reflection; using System.Text; namespace InterBaseSql.Data.Common @@ -63,6 +65,21 @@ public static Charset GetCharset(string charsetName) private static List GetSupportedCharsets() { + +#if NET5_0_OR_GREATER + // Register the extra encoding providers if possible. EncodingProvider was introduced in net5.0 + try + { + Assembly assembly = Assembly.LoadFrom("System.Text.Encoding.CodePages.dll"); + EncodingProvider provider = CodePagesEncodingProvider.Instance; + Encoding.RegisterProvider(provider); + } + catch + { + // Do nothing here, just means they won't get the additional code pages + // and work like it did before. + } +#endif var charsets = new List(); charsets.Add(new Charset(0, None, 1, None)); @@ -109,7 +126,7 @@ private static void TryAddCharset(List charsets, Func charsetC { } } - #endregion +#endregion #region Fields @@ -165,7 +182,14 @@ public Charset(int id, string name, int bytesPerCharacter, string systemName) switch (_systemName) { case None: - _encoding = Encoding.Default; + try + { + _encoding = Encoding.GetEncoding(System.Globalization.CultureInfo.CurrentCulture.TextInfo.ANSICodePage); + } + catch + { + _encoding = Encoding.Default; + } _isNone = true; break; case Octets: diff --git a/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Common/ConnectionString.cs b/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Common/ConnectionString.cs index 78b233c..8101220 100644 --- a/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Common/ConnectionString.cs +++ b/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Common/ConnectionString.cs @@ -263,7 +263,6 @@ public ConnectionString(string connectionString) : this() { Load(connectionString); - } #endregion diff --git a/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Common/DbField.cs b/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Common/DbField.cs index c4ea082..9a74c24 100644 --- a/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Common/DbField.cs +++ b/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Common/DbField.cs @@ -18,6 +18,7 @@ //$Authors = Carlos Guzman Alvarez, Jiri Cincura (jiri@cincura.net) +using InterBaseSql.Data.Client.Native; using System; using System.Text; @@ -41,14 +42,24 @@ internal sealed class DbField private DbValue _dbValue; private Charset _charset; private ArrayBase _arrayHandle; + private IBDatabase _db; #endregion #region Properties + public IBDatabase Database + { + get { return _db; } + set { _db = value; } + } + public DbDataType DbDataType { - get { return TypeHelper.GetDbDataTypeFromSqlType(SqlType, SubType, NumericScale, Length, Charset); } + get + { + return TypeHelper.GetDbDataTypeFromSqlType(SqlType, SubType, NumericScale, DbValue.Dialect, Length, Charset); + } } public int SqlType @@ -82,12 +93,23 @@ public short SubType _subType = value; if (IsCharacter()) { - // Bits 0-7 of sqlsubtype is charset_id (127 is a special value - - // current attachment charset). - // Bits 8-17 hold collation_id for this value. - var cs = BitConverter.GetBytes(value); + // If the connection's charset is not the default (None) then the + // string data is converted on the server side to the lc_ctype. + // If it is then use the sql_sub_type for the information on the encoding + // Octets (1) needs to be treeated differently + if ((_db.Charset != Charset.DefaultCharset) && (value != 1) ) + { + _charset = _db.Charset; + } + else + { + // Bits 0-7 of sqlsubtype is charset_id (127 is a special value - + // current attachment charset). + // Bits 8-17 hold collation_id for this value. + var cs = BitConverter.GetBytes(value); - _charset = Charset.GetCharset(cs[0]); + _charset = Charset.GetCharset(cs[0]); + } if (_charset == null) { @@ -180,13 +202,14 @@ public object Value #region Constructors - public DbField() + public DbField(IBDatabase DB) { _charCount = -1; _name = string.Empty; _relation = string.Empty; _owner = string.Empty; _alias = string.Empty; + _db = DB; _dbValue = new DbValue(this, DBNull.Value); } diff --git a/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Common/DbValue.cs b/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Common/DbValue.cs index ecd6f52..fd4c08d 100644 --- a/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Common/DbValue.cs +++ b/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Common/DbValue.cs @@ -30,6 +30,14 @@ internal sealed class DbValue private DbField _field; private object _value; + public short Dialect + { + get + { + return _field.Database.Dialect; + } + } + public DbField Field { get { return _field; } @@ -391,7 +399,15 @@ private object GetValue() { return GetString(); } - + case DbDataType.Char: + if (_statement == null) + { + return _value; + } + else + { + return GetString(); + } case DbDataType.Binary: if (_statement == null) { diff --git a/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Common/Descriptor.cs b/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Common/Descriptor.cs index 62b739e..7fd82d3 100644 --- a/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Common/Descriptor.cs +++ b/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Common/Descriptor.cs @@ -18,6 +18,7 @@ //$Authors = Carlos Guzman Alvarez, Jiri Cincura (jiri@cincura.net) +using InterBaseSql.Data.Client.Native; using System; using System.IO; @@ -43,6 +44,8 @@ internal sealed class Descriptor #region Properties + public IBDatabase Database; + public short Version { get @@ -79,16 +82,16 @@ public DbField this[int index] #region Constructors - public Descriptor(short n) + public Descriptor(IBDatabase DB, short n) { _version = IscCodes.SQLDA_CURRENT_VERSION; _count = n; _actualCount = n; _fields = new DbField[n]; - + Database = DB; for (var i = 0; i < n; i++) { - _fields[i] = new DbField(); + _fields[i] = new DbField(DB); } } diff --git a/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Common/TypeHelper.cs b/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Common/TypeHelper.cs index fc171db..9c21e91 100644 --- a/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Common/TypeHelper.cs +++ b/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Common/TypeHelper.cs @@ -377,9 +377,9 @@ public static Type GetTypeFromDbDataType(DbDataType type) } } - public static Type GetTypeFromBlrType(int type, int subType, int scale) + public static Type GetTypeFromBlrType(int type, int subType, int scale, short dialect) { - return GetTypeFromDbDataType(GetDbDataTypeFromBlrType(type, subType, scale)); + return GetTypeFromDbDataType(GetDbDataTypeFromBlrType(type, subType, scale, dialect)); } public static DbType GetDbTypeFromDbDataType(DbDataType type) @@ -493,12 +493,13 @@ public static DbDataType GetDbDataTypeFromDbType(DbType type) } } - public static DbDataType GetDbDataTypeFromBlrType(int type, int subType, int scale) + public static DbDataType GetDbDataTypeFromBlrType(int type, int subType, int scale, short dialect) { - return GetDbDataTypeFromSqlType(GetSqlTypeFromBlrType(type), subType, scale); + return GetDbDataTypeFromSqlType(GetSqlTypeFromBlrType(type), subType, scale, dialect); } - public static DbDataType GetDbDataTypeFromSqlType(int type, int subType, int scale, int? length = null, Charset charset = null) + public static DbDataType GetDbDataTypeFromSqlType(int type, int subType, int scale, short? dialect = 3, + int? length = null, Charset charset = null) { // Special case for Guid handling if (type == IscCodes.SQL_TEXT && length == 16 && (charset?.IsOctetsCharset ?? false)) @@ -574,22 +575,27 @@ public static DbDataType GetDbDataTypeFromSqlType(int type, int subType, int sca case IscCodes.SQL_DOUBLE: case IscCodes.SQL_D_FLOAT: - if (subType == 2) - { - return DbDataType.Decimal; - } - else if (subType == 1) - { - return DbDataType.Numeric; - } - else if (scale < 0) + if ((dialect == 3) || (!IBDBXLegacyTypes.IncludeLegacySchemaType)) { - return DbDataType.Decimal; + if (subType == 2) + { + return DbDataType.Decimal; + } + else if (subType == 1) + { + return DbDataType.Numeric; + } + else if (scale < 0) + { + return DbDataType.Decimal; + } + else + { + return DbDataType.Double; + } } else - { return DbDataType.Double; - } case IscCodes.SQL_BLOB: if (subType == 1) diff --git a/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Embarcadero.Data.InterBaseClient.csproj b/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Embarcadero.Data.InterBaseClient.csproj index c88b6b2..f16dde4 100644 --- a/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Embarcadero.Data.InterBaseClient.csproj +++ b/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Embarcadero.Data.InterBaseClient.csproj @@ -11,7 +11,7 @@ InterBase - ADO.NET Data Provider - (c) 2002-2022 + (c) 2017-2023 InterBaseSql.Data.InterBaseClient @@ -22,9 +22,9 @@ Embarcadero Embarcadero - 7.13.7.0 - 7.13.7.0 - 7.13.7 + 7.14.6.0 + 7.14.6.0 + 7.14.6 TRACE @@ -34,9 +34,11 @@ + + @@ -55,6 +57,21 @@ - + + + + 6.0.0 + + + + + 6.0.0 + + + + + 6.0.0 + + diff --git a/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/InterBaseClient/IBCharset.cs b/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/InterBaseClient/IBCharset.cs index 08377e0..4c3450e 100644 --- a/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/InterBaseClient/IBCharset.cs +++ b/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/InterBaseClient/IBCharset.cs @@ -50,11 +50,9 @@ public enum IBCharset Windows1254 = 55, Big5 = 56, Gb2312 = 57, - Windows1255 = 58, - Windows1256 = 59, - Windows1257 = 60, - Koi8R = 63, - Koi8U = 64, - TIS620 = 65, + UNICODE_BE = 8, + ISO8859_15 = 39, + KOI8R = 58, + UNICODE_LE = 64, } } diff --git a/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/InterBaseClient/IBCommand.cs b/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/InterBaseClient/IBCommand.cs index 616bd19..3524ccf 100644 --- a/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/InterBaseClient/IBCommand.cs +++ b/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/InterBaseClient/IBCommand.cs @@ -29,6 +29,7 @@ using InterBaseSql.Data.Common; using InterBaseSql.Data.Logging; using System.Linq; +using InterBaseSql.Data.Client.Native; namespace InterBaseSql.Data.InterBaseClient { @@ -785,7 +786,7 @@ private Descriptor BuildParametersDescriptor() private Descriptor BuildNamedParametersDescriptor(short count) { - var descriptor = new Descriptor(count); + var descriptor = new Descriptor((IBDatabase) _connection.IBDatabase, count); var index = 0; for (var i = 0; i < _namedParameters.Count; i++) @@ -813,7 +814,7 @@ private Descriptor BuildNamedParametersDescriptor(short count) private Descriptor BuildPlaceHoldersDescriptor(short count) { - var descriptor = new Descriptor(count); + var descriptor = new Descriptor((IBDatabase) _connection.IBDatabase, count); var index = 0; for (var i = 0; i < Parameters.Count; i++) diff --git a/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/InterBaseClient/IBConnection.cs b/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/InterBaseClient/IBConnection.cs index 9b0c9b9..01c71be 100644 --- a/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/InterBaseClient/IBConnection.cs +++ b/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/InterBaseClient/IBConnection.cs @@ -208,7 +208,7 @@ public bool TruncateChar { if (!IsClosed) { - throw new InvalidOperationException("Operation requires an open and available connection."); + throw new InvalidOperationException("Changing TruncateChar requires a closed connection as it modifies the connectionstring."); } var newOptions = new IBConnectionStringBuilder(_connectionString); newOptions.TruncateChar = value; @@ -415,7 +415,10 @@ public override DataTable GetSchema(string collectionName, string[] restrictions { CheckClosed(); - return _innerConnection.GetSchema(collectionName, restrictions); + if (!IBDBXLegacyTypes.IncludeLegacySchemaType) + return _innerConnection.GetSchema(collectionName, restrictions); + else + return IBDBXLegacyTypes.UpdateColumnNames( _innerConnection.GetSchema(collectionName, restrictions)); } #endregion diff --git a/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/InterBaseClient/IBConnectionStringBuilder.cs b/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/InterBaseClient/IBConnectionStringBuilder.cs index 86f78ef..c19ee2b 100644 --- a/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/InterBaseClient/IBConnectionStringBuilder.cs +++ b/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/InterBaseClient/IBConnectionStringBuilder.cs @@ -21,9 +21,9 @@ using System; using System.Data; using System.Data.Common; -using System.Globalization; -using System.Text; using System.ComponentModel; +using System.Xml; +using System.Reflection; namespace InterBaseSql.Data.InterBaseClient { @@ -344,6 +344,63 @@ public IBConnectionStringBuilder(string connectionString) { ConnectionString = connectionString; } + #endregion + + #region Public methods + + // Can not use serialization due to DbconnectionStringBuilder having IDictionary + public void WriteToXML(string FileName) + { + XmlWriterSettings settings = new XmlWriterSettings + { + Indent = true, + IndentChars = " ", // Use spaces for indentation + NewLineChars = "\n" // Use newline character for new lines + }; + + using (XmlWriter writer = XmlWriter.Create(FileName, settings)) + { + // Start writing the root element + writer.WriteStartElement("IBConnectionStringBuilder"); + PropertyInfo[] sourceProperties = this.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly); + + foreach (var sourceProperty in sourceProperties) + { + if (sourceProperty.GetIndexParameters().Length == 0) + { + object value = sourceProperty.GetValue(this); + writer.WriteStartElement(sourceProperty.Name); + writer.WriteString(value.ToString()); + writer.WriteEndElement(); + } + } + // End the root element + writer.WriteEndElement(); + } + } + + public void ReadFromXML(string FileName) + { + XmlDocument doc = new XmlDocument(); + doc.Load(FileName); + + PropertyInfo[] sourceProperties = this.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly); + XmlNodeList nodes = doc.SelectNodes("//IBConnectionStringBuilder"); + foreach (XmlNode node in nodes) + { + foreach (var propertyInfo in sourceProperties) + { + string innerText = node[propertyInfo.Name]!.InnerText; + Type type = propertyInfo.PropertyType; + AttributeCollection attributes = TypeDescriptor.GetProperties(this)[propertyInfo.Name].Attributes; + string curDefault = ((DefaultValueAttribute)attributes[typeof(DefaultValueAttribute)]).Value.ToString(); + Type propertyType = propertyInfo.PropertyType; + object value = ((!propertyType.IsEnum) ? Convert.ChangeType(innerText, propertyType) : Enum.Parse(propertyType, innerText)); + if ((curDefault != innerText) && (value != propertyInfo.GetValue(this))) + propertyInfo.SetValue(this, value); + } + } + } #endregion diff --git a/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/InterBaseClient/IBDataReader.cs b/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/InterBaseClient/IBDataReader.cs index 27621f1..9a9ba69 100644 --- a/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/InterBaseClient/IBDataReader.cs +++ b/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/InterBaseClient/IBDataReader.cs @@ -22,12 +22,15 @@ using System.Collections; using System.Collections.Generic; using System.ComponentModel; +using System.ComponentModel.Design; using System.Data; using System.Data.Common; +using System.Data.SqlTypes; using System.Globalization; using System.Linq; - +using InterBaseSql.Data.Client.Native; using InterBaseSql.Data.Common; +using InterBaseSql.Data.Schema; namespace InterBaseSql.Data.InterBaseClient { @@ -236,12 +239,14 @@ public override DataTable GetSchemaTable() _command.Connection, _command.Connection.InnerConnection.ActiveTransaction); - schemaCmd.Parameters.Add("@TABLE_NAME", IBDbType.Char, 31); - schemaCmd.Parameters.Add("@COLUMN_NAME", IBDbType.Char, 31); + schemaCmd.Parameters.Add("@TABLE_NAME", IBDbType.Char, 68); + schemaCmd.Parameters.Add("@COLUMN_NAME", IBDbType.Char, 68); schemaCmd.Prepare(); _schemaTable.BeginLoadData(); + var emptyCount = 1; + for (var i = 0; i < _fields.Count; i++) { var isKeyColumn = false; @@ -249,6 +254,7 @@ public override DataTable GetSchemaTable() var isReadOnly = false; var precision = 0; var isExpression = false; + var fieldType = 0; /* Get Schema data for the field */ schemaCmd.Parameters[0].Value = _fields[i].Relation; @@ -263,6 +269,7 @@ public override DataTable GetSchemaTable() isUnique = (r.GetInt32(3) == 1) ? true : false; precision = r.IsDBNull(4) ? -1 : r.GetInt32(4); isExpression = IsExpression(r); + fieldType = r.GetInt32(5); } } @@ -275,12 +282,20 @@ public override DataTable GetSchemaTable() if (_fields[i].IsDecimal()) { schemaRow["NumericPrecision"] = schemaRow["ColumnSize"]; + if ((precision == -1) && (_fields[i].NumericScale != 0)) + precision = 15; if (precision > 0) { schemaRow["NumericPrecision"] = precision; } schemaRow["NumericScale"] = _fields[i].NumericScale * (-1); } + if ((_fields[i].DbDataType == DbDataType.Double) || (fieldType == IscCodes.blr_double)) + { + if ((precision == -1) && (_fields[i].NumericScale != 0)) + schemaRow["NumericPrecision"] = 15; + schemaRow["NumericScale"] = _fields[i].NumericScale * (-1); + } schemaRow["DataType"] = GetFieldType(i); schemaRow["ProviderType"] = GetProviderType(i); schemaRow["IsLong"] = _fields[i].IsLong(); @@ -297,6 +312,50 @@ public override DataTable GetSchemaTable() schemaRow["BaseTableName"] = _fields[i].Relation; schemaRow["BaseColumnName"] = _fields[i].Name; + if (IBDBXLegacyTypes.IncludeLegacySchemaType) + { + schemaRow["DbxDataType"] = IBDBXLegacyTypes.GetLegacyType(_connection.DBSQLDialect, GetLegacyProviderType(i)); + if (_fields[i].DbDataType == DbDataType.Char) + schemaRow["DbxSubType"] = 31; + else + schemaRow["DbxSubType"] = 0; + + if (schemaRow["ColumnName"].ToString() == "") + { + schemaRow["ColumnName"] = "Mycolumn" + emptyCount; + emptyCount = emptyCount + 1; + } + if ((_fields[i].IsDecimal() || (_fields[i].DbDataType == DbDataType.Double))) + { + if ((fieldType == IscCodes.blr_double) && + (_fields[i].NumericScale == 0)) + schemaRow["DbxPrecision"] = 8; + else if (precision == -1) + schemaRow["DbxPrecision"] = 15; + else + schemaRow["DbxPrecision"] = precision; + + } + else + schemaRow["DbxPrecision"] = _fields[i].GetSize(); + if ((_fields[i].DbDataType == DbDataType.Binary) || (_fields[i].DbDataType == DbDataType.Text)) + { + if (_fields[i].SubType == 1) + { + schemaRow["DbxSubType"] = 22; + schemaRow["DbxPrecision"] = 1; + } + else + { + schemaRow["DbxSubType"] = 23; + schemaRow["DbxPrecision"] = 1; + } + } + schemaRow["IsHidden"] = false; + schemaRow["NumericScale"] = _fields[i].NumericScale * (-1); + schemaRow["BaseSchemaName"] = DBNull.Value; + } + _schemaTable.Rows.Add(schemaRow); if (!string.IsNullOrEmpty(_fields[i].Relation) && currentTable != _fields[i].Relation) @@ -667,6 +726,49 @@ private IBDbType GetProviderType(int i) return (IBDbType)_fields[i].DbDataType; } + private IBDbType GetLegacyProviderType(int i) + { + switch (_fields[i].SqlType) + { + case IscCodes.SQL_TEXT: + case IscCodes.SQL_VARYING: + case IscCodes.SQL_FLOAT: + case IscCodes.SQL_TIMESTAMP: + case IscCodes.SQL_TYPE_TIME: + case IscCodes.SQL_TYPE_DATE: + case IscCodes.SQL_ARRAY: + case IscCodes.SQL_BOOLEAN: + case IscCodes.SQL_SHORT: + case IscCodes.SQL_LONG: + case IscCodes.SQL_QUAD: + case IscCodes.SQL_INT64: + case IscCodes.SQL_BLOB: + { + return GetProviderType(i); + } + + case IscCodes.SQL_DOUBLE: + case IscCodes.SQL_D_FLOAT: + if (_fields[i].SubType == 2) + { + return IBDbType.Decimal; + } + else if (_fields[i].SubType == 1) + { + return IBDbType.Numeric; + } + else if (_fields[i].NumericScale < 0) + { + return IBDbType.Decimal; + } + else + { + return IBDbType.Double; + } + default: + return GetProviderType(i); + } + } private void UpdateRecordsAffected() { if (_command != null && !_command.IsDisposed) @@ -758,6 +860,14 @@ private static DataTable GetSchemaTableStructure() schema.Columns.Add("BaseTableName", System.Type.GetType("System.String")); schema.Columns.Add("BaseColumnName", System.Type.GetType("System.String")); + if (IBDBXLegacyTypes.IncludeLegacySchemaType) + { + schema.Columns.Add("DbxDataType", System.Type.GetType("System.Int32")); + schema.Columns.Add("DbxSubType", System.Type.GetType("System.Int32")); + schema.Columns.Add("DbxPrecision", System.Type.GetType("System.Int32")); + schema.Columns.Add("IsHidden", System.Type.GetType("System.Boolean")); + } + return schema; } @@ -779,7 +889,8 @@ private static string GetSchemaCommandText() WHERE rel.rdb$constraint_type = 'UNIQUE' AND rel.rdb$relation_name = rfr.rdb$relation_name AND seg.rdb$field_name = rfr.rdb$field_name) AS unique_key, - fld.rdb$field_precision AS numeric_precision + fld.rdb$field_precision AS numeric_precision, + fld.rdb$field_type AS FIELD_TYPE FROM rdb$relation_fields rfr INNER JOIN rdb$fields fld ON rfr.rdb$field_source = fld.rdb$field_name WHERE rfr.rdb$relation_name = ? diff --git a/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/InterBaseClient/changelog.md b/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/InterBaseClient/changelog.md index 51a1240..71ca1fb 100644 --- a/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/InterBaseClient/changelog.md +++ b/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/InterBaseClient/changelog.md @@ -1,3 +1,28 @@ +# Changes for 7.14.6 + +## IBCharset.cs +* Updated the enum to reflect the correct values for IB. + +## IBCommand.cs +* Updated passing the Database to the Descriptor + +## IBConnection +* Corrected the exception message when trying to change TruncateChar with an active connection (old message was reverse of what it should be) +* GetSchema now supports the new IBDBXLegacyTypes.IncludeLegacySchemaType switch + +## IBDataReader.cs +* GetSchemaTable now correctly sets the table and column name parameters to 68 not 31 +* GetSchemaTable Fixed when in dialect 1 the datatype is a Double. +* GetSchemaTable added support for IBDBXLegacyTypes.IncludeLegacySchemaType +* GetLegacyProviderType added for legacy support +* GetSchemaTableStructure added legacy support + +## IBDBXLegacyTypes.cs (new) +* Support routines when in schema legacy mode. + +## IBConnectionStringbuilder +* Added WriteToXML and ReadFromXML to support stremaing a connection string in from an XML file. + #Changes for 7.13.6 ## IBCommand.cs diff --git a/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Schema/Changelog.md b/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Schema/Changelog.md index 4fe06e3..8bc8df9 100644 --- a/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Schema/Changelog.md +++ b/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Schema/Changelog.md @@ -1,3 +1,18 @@ +# Changes for 7.14.6 + +# IBChecksByTable.cs +* GetCommandText - fixed pulling the wrong column for the constraint name + +# IBColumns.cs, IBForeignKeyColumns.cs, IBForeignKeys.cs, IBIndexColumns.cs, IBIndexes.cs, IBProcedureParameters.cs, IBProcedures.cs, IBTableConstraints.cs +* Support added for IBDBXLegacyTypes.IncludeLegacySchemaType being true + +# IBSchema.cs +* Added a Dialect parameter for support of dialect 1 + +# IBMetaData.xml, IBLegacryData.XML + +* Updated the reserved words to IB only words. So added some and removed Fb specific ones. This is used in schema catalogs + # Changes for 7.10.2 ## General diff --git a/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Schema/IBChecksByTable.cs b/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Schema/IBChecksByTable.cs index 281b2c9..a35d217 100644 --- a/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Schema/IBChecksByTable.cs +++ b/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Schema/IBChecksByTable.cs @@ -63,7 +63,7 @@ FROM rdb$relation_constraints chktb /* CONSTRAINT_NAME */ if (restrictions.Length >= 3 && restrictions[2] != null) { - where.AppendFormat("chktb.rdb$constraint_name = @p{0}", index++); + where.AppendFormat("chktb.rdb$relation_name = @p{0}", index++); } } diff --git a/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Schema/IBColumns.cs b/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Schema/IBColumns.cs index 54542f6..2a8d4aa 100644 --- a/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Schema/IBColumns.cs +++ b/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Schema/IBColumns.cs @@ -22,7 +22,6 @@ using System.Data; using System.Globalization; using System.Text; - using InterBaseSql.Data.Common; using InterBaseSql.Data.InterBaseClient; @@ -120,6 +119,16 @@ protected override DataTable ProcessResult(DataTable schema) schema.BeginLoadData(); schema.Columns.Add("IS_NULLABLE", typeof(bool)); schema.Columns.Add("IS_ARRAY", typeof(bool)); + if (IBDBXLegacyTypes.IncludeLegacySchemaType) + { + schema.Columns.Add("DbxDataType", typeof(int)); + schema.Columns.Add("IsFixedLength", typeof(bool)); + schema.Columns.Add("IsUnicode", typeof(bool)); + schema.Columns.Add("IsLong", typeof(bool)); + schema.Columns.Add("IsUnsigned", typeof(bool)); + schema.Columns.Add("MaxInline", typeof(string)); + schema.Columns.Add("IsAutoIncrement", typeof(bool)); + } foreach (DataRow row in schema.Rows) { @@ -140,7 +149,7 @@ protected override DataTable ProcessResult(DataTable schema) row["IS_NULLABLE"] = (row["COLUMN_NULLABLE"] == DBNull.Value); row["IS_ARRAY"] = (row["COLUMN_ARRAY"] != DBNull.Value); - var dbType = (IBDbType)TypeHelper.GetDbDataTypeFromBlrType(blrType, subType, scale); + var dbType = (IBDbType)TypeHelper.GetDbDataTypeFromBlrType(blrType, subType, scale, Dialect); row["COLUMN_DATA_TYPE"] = TypeHelper.GetDataTypeName((DbDataType)dbType).ToLowerInvariant(); if (dbType == IBDbType.Binary || dbType == IBDbType.Text) @@ -178,6 +187,16 @@ protected override DataTable ProcessResult(DataTable schema) { row["DOMAIN_NAME"] = null; } + if (IBDBXLegacyTypes.IncludeLegacySchemaType) + { + row["DbxDataType"] = IBDBXLegacyTypes.GetLegacyType(Dialect, IBDBXLegacyTypes.GetLegacyProviderType(dbType, subType, scale)); ; + row["IsFixedLength"] = IBDBXLegacyTypes.FixedLength.Contains(dbType); + row["IsUnicode"] = false; + row["IsLong"] = false; + row["IsUnsigned"] = IBDBXLegacyTypes.IsLong.Contains(dbType); + row["ORDINAL_POSITION"] = (short) row["ORDINAL_POSITION"] + 1; + row["IsAutoIncrement"] = false; + } } schema.EndLoadData(); diff --git a/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Schema/IBDomains.cs b/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Schema/IBDomains.cs index aa0151a..0ac8bb3 100644 --- a/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Schema/IBDomains.cs +++ b/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Schema/IBDomains.cs @@ -121,7 +121,7 @@ protected override DataTable ProcessResult(DataTable schema) row["IS_NULLABLE"] = (row["COLUMN_NULLABLE"] == DBNull.Value); row["IS_ARRAY"] = (row["COLUMN_ARRAY"] != DBNull.Value); - var dbType = (IBDbType)TypeHelper.GetDbDataTypeFromBlrType(blrType, subType, scale); + var dbType = (IBDbType)TypeHelper.GetDbDataTypeFromBlrType(blrType, subType, scale, Dialect); row["DOMAIN_DATA_TYPE"] = TypeHelper.GetDataTypeName((DbDataType)dbType).ToLowerInvariant(); if (dbType == IBDbType.Char || dbType == IBDbType.VarChar) diff --git a/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Schema/IBForeignKeyColumns.cs b/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Schema/IBForeignKeyColumns.cs index bb188ca..e28261f 100644 --- a/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Schema/IBForeignKeyColumns.cs +++ b/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Schema/IBForeignKeyColumns.cs @@ -22,6 +22,7 @@ using System.Data; using System.Globalization; using System.Text; +using InterBaseSql.Data.InterBaseClient; namespace InterBaseSql.Data.Schema { @@ -34,8 +35,10 @@ protected override StringBuilder GetCommandText(string[] restrictions) var sql = new StringBuilder(); var where = new StringBuilder(); - sql.Append( - @"SELECT + if (!IBDBXLegacyTypes.IncludeLegacySchemaType) + { + sql.Append( + @"SELECT null AS CONSTRAINT_CATALOG, null AS CONSTRAINT_SCHEMA, co.rdb$constraint_name AS CONSTRAINT_NAME, @@ -54,6 +57,32 @@ FROM rdb$relation_constraints co INNER JOIN rdb$index_segments coidxseg ON co.rdb$index_name = coidxseg.rdb$index_name INNER JOIN rdb$indices refidx ON refidx.rdb$index_name = tempidx.rdb$foreign_key INNER JOIN rdb$index_segments refidxseg ON refidxseg.rdb$index_name = refidx.rdb$index_name AND refidxseg.rdb$field_position = coidxseg.rdb$field_position"); + } + + else + sql.Append( + @"SELECT + null AS CONSTRAINT_CATALOG, + null AS CONSTRAINT_SCHEMA, + co.rdb$constraint_name AS CONSTRAINT_NAME, + null AS TABLE_CATALOG, + null AS TABLE_SCHEMA, + co.rdb$relation_name AS TABLE_NAME, + coidxseg.rdb$field_name AS COLUMN_NAME, + null as REFERENCED_TABLE_CATALOG, + null as REFERENCED_TABLE_SCHEMA, + refidx.rdb$relation_name as REFERENCED_TABLE_NAME, + refidxseg.rdb$field_name AS REFERENCED_COLUMN_NAME, + coidxseg.rdb$field_position as ORDINAL_POSITION, + (select rdb$constraint_name from rdb$relation_constraints co2 + where co2.rdb$relation_name = refidx.rdb$relation_name and + co2.rdb$constraint_type = 'PRIMARY KEY') as REFERENCED_KEY_NAME + FROM rdb$relation_constraints co + INNER JOIN rdb$ref_constraints ref ON co.rdb$constraint_name = ref.rdb$constraint_name + INNER JOIN rdb$indices tempidx ON co.rdb$index_name = tempidx.rdb$index_name + INNER JOIN rdb$index_segments coidxseg ON co.rdb$index_name = coidxseg.rdb$index_name + INNER JOIN rdb$indices refidx ON refidx.rdb$index_name = tempidx.rdb$foreign_key + INNER JOIN rdb$index_segments refidxseg ON refidxseg.rdb$index_name = refidx.rdb$index_name AND refidxseg.rdb$field_position = coidxseg.rdb$field_position"); where.Append("co.rdb$constraint_type = 'FOREIGN KEY'"); @@ -100,6 +129,33 @@ FROM rdb$relation_constraints co return sql; } + protected override DataTable ProcessResult(DataTable schema) + { + schema.BeginLoadData(); + if (IBDBXLegacyTypes.IncludeLegacySchemaType) + { + schema.Columns.Add("PrimarycatalogName", typeof(string)); + schema.Columns.Add("PrimarySchemaName", typeof(string)); + } + foreach (DataRow row in schema.Rows) + { + if (IBDBXLegacyTypes.IncludeLegacySchemaType) + { + row["ORDINAL_POSITION"] = (short)row["ORDINAL_POSITION"] + 1; + } + } + // not in the Dbx stuff but does cause a mapping of the names to the same thing + // CONSTRAINT_CATALOG and CONSTRAINT_SCHEMA maps too + if (IBDBXLegacyTypes.IncludeLegacySchemaType) + { + schema.Columns.Remove("TABLE_CATALOG"); + schema.Columns.Remove("TABLE_SCHEMA"); + } + schema.EndLoadData(); + schema.AcceptChanges(); + + return schema; + } #endregion } } diff --git a/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Schema/IBForeignKeys.cs b/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Schema/IBForeignKeys.cs index e34d41b..a770b2b 100644 --- a/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Schema/IBForeignKeys.cs +++ b/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Schema/IBForeignKeys.cs @@ -22,6 +22,7 @@ using System.Data; using System.Globalization; using System.Text; +using InterBaseSql.Data.InterBaseClient; namespace InterBaseSql.Data.Schema { @@ -81,7 +82,7 @@ FROM rdb$relation_constraints co /* CONSTRAINT_NAME */ if (restrictions.Length >= 4 && restrictions[3] != null) { - where.AppendFormat(" AND rel.rdb$constraint_name = @p{0}", index++); + where.AppendFormat(" AND co.rdb$constraint_name = @p{0}", index++); } } @@ -94,6 +95,22 @@ FROM rdb$relation_constraints co return sql; } + protected override DataTable ProcessResult(DataTable schema) + { + schema.BeginLoadData(); + // not in the Dbx stuff but does cause a mapping of the names to the same thing + // CONSTRAINT_CATALOG and CONSTRAINT_SCHEMA maps too + // All the Catalog/Schema stuff is always NULL as they are not IB concepts + if (IBDBXLegacyTypes.IncludeLegacySchemaType) + { + schema.Columns.Remove("TABLE_CATALOG"); + schema.Columns.Remove("TABLE_SCHEMA"); + } + schema.EndLoadData(); + schema.AcceptChanges(); + + return schema; + } #endregion } diff --git a/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Schema/IBIndexColumns.cs b/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Schema/IBIndexColumns.cs index 4380ca2..2a085bc 100644 --- a/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Schema/IBIndexColumns.cs +++ b/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Schema/IBIndexColumns.cs @@ -22,6 +22,7 @@ using System.Data; using System.Globalization; using System.Text; +using InterBaseSql.Data.InterBaseClient; namespace InterBaseSql.Data.Schema { @@ -38,7 +39,7 @@ protected override StringBuilder GetCommandText(string[] restrictions) @"SELECT null AS CONSTRAINT_CATALOG, null AS CONSTRAINT_SCHEMA, - idx.rdb$index_name AS CONSTRAINT_NAME, + rcon.rdb$constraint_name AS LEG_CONSTRAINT_NAME, null AS TABLE_CATALOG, null AS TABLE_SCHEMA, idx.rdb$relation_name AS TABLE_NAME, @@ -46,7 +47,8 @@ protected override StringBuilder GetCommandText(string[] restrictions) seg.rdb$field_position AS ORDINAL_POSITION, idx.rdb$index_name AS INDEX_NAME FROM rdb$indices idx - LEFT JOIN rdb$index_segments seg ON idx.rdb$index_name = seg.rdb$index_name"); + LEFT JOIN rdb$index_segments seg ON idx.rdb$index_name = seg.rdb$index_name + LEFT JOIN rdb$relation_constraints rcon ON idx.rdb$index_name = rcon.rdb$index_name"); if (restrictions != null) { @@ -102,5 +104,29 @@ FROM rdb$indices idx } #endregion + protected override DataTable ProcessResult(DataTable schema) + { + schema.BeginLoadData(); + foreach (DataRow row in schema.Rows) + { + if (IBDBXLegacyTypes.IncludeLegacySchemaType) + { + row["ORDINAL_POSITION"] = (short)row["ORDINAL_POSITION"] + 1; + } + } + // not in the Dbx stuff but does cause a mapping of the names to the same thing + // CONSTRAINT_CATALOG and CONSTRAINT_SCHEMA maps too + if (IBDBXLegacyTypes.IncludeLegacySchemaType) + { + schema.Columns.Remove("TABLE_CATALOG"); + schema.Columns.Remove("TABLE_SCHEMA"); + } + else + schema.Columns["LEG_CONSTRAINT_NAME"].ColumnName = "CONSTRAINT_NAME"; + schema.EndLoadData(); + schema.AcceptChanges(); + + return schema; + } } } diff --git a/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Schema/IBIndexes.cs b/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Schema/IBIndexes.cs index 674733e..1194509 100644 --- a/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Schema/IBIndexes.cs +++ b/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Schema/IBIndexes.cs @@ -22,6 +22,8 @@ using System.Data; using System.Globalization; using System.Text; +using InterBaseSql.Data.Common; +using InterBaseSql.Data.InterBaseClient; namespace InterBaseSql.Data.Schema { @@ -34,22 +36,42 @@ protected override StringBuilder GetCommandText(string[] restrictions) var sql = new StringBuilder(); var where = new StringBuilder(); - sql.Append( - @"SELECT - null AS TABLE_CATALOG, - null AS TABLE_SCHEMA, - idx.rdb$relation_name AS TABLE_NAME, - idx.rdb$index_name AS INDEX_NAME, - idx.rdb$index_inactive AS IS_INACTIVE, - idx.rdb$unique_flag AS IS_UNIQUE, - (SELECT COUNT(*) FROM rdb$relation_constraints rel - WHERE rel.rdb$constraint_type = 'PRIMARY KEY' AND rel.rdb$index_name = idx.rdb$index_name AND rel.rdb$relation_name = idx.rdb$relation_name) as PRIMARY_KEY, - (SELECT COUNT(*) FROM rdb$relation_constraints rel - WHERE rel.rdb$constraint_type = 'UNIQUE' AND rel.rdb$index_name = idx.rdb$index_name AND rel.rdb$relation_name = idx.rdb$relation_name) as UNIQUE_KEY, - idx.rdb$system_flag AS IS_SYSTEM_INDEX, - idx.rdb$index_type AS INDEX_TYPE, - idx.rdb$description AS DESCRIPTION + if (!IBDBXLegacyTypes.IncludeLegacySchemaType) + sql.Append( + @"SELECT + null AS TABLE_CATALOG, + null AS TABLE_SCHEMA, + idx.rdb$relation_name AS TABLE_NAME, + idx.rdb$index_name AS INDEX_NAME, + idx.rdb$index_inactive AS IS_INACTIVE, + idx.rdb$unique_flag AS IS_UNIQUE, + (SELECT COUNT(*) FROM rdb$relation_constraints rel + WHERE rel.rdb$constraint_type = 'PRIMARY KEY' AND rel.rdb$index_name = idx.rdb$index_name AND rel.rdb$relation_name = idx.rdb$relation_name) as PRIMARY_KEY, + (SELECT COUNT(*) FROM rdb$relation_constraints rel + WHERE rel.rdb$constraint_type = 'UNIQUE' AND rel.rdb$index_name = idx.rdb$index_name AND rel.rdb$relation_name = idx.rdb$relation_name) as UNIQUE_KEY, + idx.rdb$system_flag AS IS_SYSTEM_INDEX, + idx.rdb$index_type AS INDEX_TYPE, + idx.rdb$description AS DESCRIPTION FROM rdb$indices idx"); + else + sql.Append( + @"SELECT + null AS TABLE_CATALOG, + null AS TABLE_SCHEMA, + idx.rdb$relation_name AS TABLE_NAME, + idx.rdb$index_name AS INDEX_NAME, + idx.rdb$index_inactive AS IS_INACTIVE, + idx.rdb$unique_flag AS IS_UNIQUE, + (SELECT COUNT(*) FROM rdb$relation_constraints rel + WHERE rel.rdb$constraint_type = 'PRIMARY KEY' AND rel.rdb$index_name = idx.rdb$index_name AND rel.rdb$relation_name = idx.rdb$relation_name) as PRIMARY_KEY, + (SELECT COUNT(*) FROM rdb$relation_constraints rel + WHERE rel.rdb$constraint_type = 'UNIQUE' AND rel.rdb$index_name = idx.rdb$index_name AND rel.rdb$relation_name = idx.rdb$relation_name) as UNIQUE_KEY, + idx.rdb$system_flag AS IS_SYSTEM_INDEX, + idx.rdb$index_type AS INDEX_TYPE, + idx.rdb$description AS DESCRIPTION , + (select rdb$constraint_name from rdb$relation_constraints where rdb$relation_name = idx.rdb$relation_name and rdb$index_name = idx.rdb$index_name) as LEG_CONSTRAINT_NAME + FROM rdb$indices idx"); + if (restrictions != null) { @@ -97,6 +119,11 @@ protected override DataTable ProcessResult(DataTable schema) { schema.BeginLoadData(); schema.Columns.Add("IS_PRIMARY", typeof(bool)); + if (IBDBXLegacyTypes.IncludeLegacySchemaType) + { + schema.Columns.Add("IsAscending", typeof(bool)); + schema.Columns.Add("IsUnique", typeof(bool)); + } foreach (DataRow row in schema.Rows) { @@ -107,6 +134,11 @@ protected override DataTable ProcessResult(DataTable schema) row["IS_INACTIVE"] = !(row["IS_INACTIVE"] == DBNull.Value || Convert.ToInt32(row["IS_INACTIVE"], CultureInfo.InvariantCulture) == 0); row["IS_SYSTEM_INDEX"] = !(row["IS_SYSTEM_INDEX"] == DBNull.Value || Convert.ToInt32(row["IS_SYSTEM_INDEX"], CultureInfo.InvariantCulture) == 0); + if (IBDBXLegacyTypes.IncludeLegacySchemaType) + { + row["IsAscending"] = !(row["INDEX_TYPE"] == DBNull.Value || Convert.ToInt32(row["INDEX_TYPE"], CultureInfo.InvariantCulture) != 0); + row["IsUnique"] = !(row["IS_UNIQUE"] == DBNull.Value || Convert.ToInt32(row["IS_UNIQUE"], CultureInfo.InvariantCulture) == 0); + } } schema.EndLoadData(); diff --git a/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Schema/IBMetaData.xml b/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Schema/IBMetaData.xml index 354b5c8..b04a8a1 100644 --- a/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Schema/IBMetaData.xml +++ b/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Schema/IBMetaData.xml @@ -1315,9 +1315,6 @@ AVG - - BASE_NAME - BEFORE @@ -1328,13 +1325,13 @@ BETWEEN - BIGINT + BLOB - BLOB + BOOLEAN - BREAK + BUFFERS BY @@ -1360,15 +1357,15 @@ CHECK - - CHECK_POINT_LENGTH - COALESCE COLLATE + + COLLATION + COLUMN @@ -1384,9 +1381,6 @@ CONDITIONAL - - CONNECTION_ID - CONSTRAINT @@ -1408,18 +1402,12 @@ CURRENT_DATE - - CURRENT_ROLE - CURRENT_TIME CURRENT_TIMESTAMP - - CURRENT_USER - CURSOR @@ -1444,6 +1432,9 @@ DECLARE + + DECRYPT + DEFAULT @@ -1477,6 +1468,12 @@ ELSE + + ENCRYPT + + + ENCRYPTION + END @@ -1489,6 +1486,12 @@ EXCEPTION + + EXCLUSIVE + + + EXCLUSIVITY + EXECUTE @@ -1505,13 +1508,13 @@ EXTRACT - FILE + FALSE - FILTER + FILE - FIRST + FILTER FLOAT @@ -1537,11 +1540,14 @@ GDSCODE + + GEN_ID + GENERATOR - GEN_ID + GLOBAL GRANT @@ -1549,9 +1555,6 @@ GROUP - - GROUP_COMMIT_WAIT_TIME - HAVING @@ -1600,9 +1603,6 @@ KEY - - LAST - LEFT @@ -1615,12 +1615,6 @@ LIKE - - LOGFILE - - - LOG_BUFFER_SIZE - LONG @@ -1669,24 +1663,15 @@ NOT - - NULLIF - NULL - NULLS - - - LOCK + NULLIF NUMERIC - - NUM_LOG_BUFFERS - OF @@ -1711,17 +1696,14 @@ OUTPUT_TYPE - - OVERFLOW - PAGE - PAGES + PAGE_SIZE - PAGE_SIZE + PAGES PARAMETER @@ -1729,6 +1711,9 @@ PASSWORD + + PERCENT + PLAN @@ -1741,6 +1726,9 @@ PRECISION + + PRESERVE + PRIMARY @@ -1769,11 +1757,14 @@ RECORD_VERSION - RECREATE + RECURSIVE REFERENCES + + RELEASE + RESERV @@ -1805,7 +1796,10 @@ ROLLBACK - ROWS_AFFECTED + ROW + + + ROWS SAVEPOINT @@ -1837,9 +1831,6 @@ SIZE - - SKIP - SMALLINT @@ -1867,9 +1858,6 @@ STATISTICS - - SUBSTRING - SUB_TYPE @@ -1882,9 +1870,18 @@ TABLE + + TABLESPACE + + + TEMPORARY + THEN + + TIES + TIME @@ -1898,10 +1895,13 @@ TRANSACTION - TRANSACTION_ID + TRIGGER - TRIGGER + TRUE + + + TRUNCATE TYPE @@ -1915,6 +1915,9 @@ UNIQUE + + UNKNOWN + UPDATE @@ -1924,9 +1927,6 @@ USER - - USING - VALUE diff --git a/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Schema/IBProcedureParameters.cs b/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Schema/IBProcedureParameters.cs index 30f201f..1d9459c 100644 --- a/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Schema/IBProcedureParameters.cs +++ b/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Schema/IBProcedureParameters.cs @@ -19,6 +19,7 @@ //$Authors = Carlos Guzman Alvarez, Jiri Cincura (jiri@cincura.net) using System; +using System.Collections.Generic; using System.Data; using System.Globalization; using System.Text; @@ -31,6 +32,9 @@ namespace InterBaseSql.Data.Schema internal class IBProcedureParameters : IBSchema { #region Protected Methods + static Dictionary ColName = new Dictionary(); + static Dictionary ColName_legacy = new Dictionary(); + private Dictionary _colName; protected override StringBuilder GetCommandText(string[] restrictions) { @@ -114,6 +118,15 @@ protected override DataTable ProcessResult(DataTable schema) { schema.BeginLoadData(); schema.Columns.Add("IS_NULLABLE", typeof(bool)); + if (IBDBXLegacyTypes.IncludeLegacySchemaType) + { + schema.Columns.Add("DbxDataType", typeof(int)); + schema.Columns.Add("IsFixedLength", typeof(bool) ); + schema.Columns.Add("IsUnicode", typeof(bool)); + schema.Columns.Add("IsLong", typeof(bool)); + schema.Columns.Add("IsUnsigned", typeof(bool)); + schema.Columns.Add("ParameterMode", typeof(string)); + } foreach (DataRow row in schema.Rows) { @@ -133,7 +146,7 @@ protected override DataTable ProcessResult(DataTable schema) row["IS_NULLABLE"] = (row["COLUMN_NULLABLE"] == DBNull.Value); - var dbType = (IBDbType)TypeHelper.GetDbDataTypeFromBlrType(blrType, subType, scale); + var dbType = (IBDbType)TypeHelper.GetDbDataTypeFromBlrType(blrType, subType, scale, Dialect); row["PARAMETER_DATA_TYPE"] = TypeHelper.GetDataTypeName((DbDataType)dbType).ToLowerInvariant(); if (dbType == IBDbType.Char || dbType == IBDbType.VarChar) @@ -174,6 +187,25 @@ protected override DataTable ProcessResult(DataTable schema) row["PARAMETER_DIRECTION"] = ParameterDirection.Output; break; } + if (IBDBXLegacyTypes.IncludeLegacySchemaType) + { + switch (direction) + { + case 0: + row["ParameterMode"] = "IN"; + break; + + case 1: + row["ParameterMode"] = "OUT"; + break; + } + row["DbxDataType"] = IBDBXLegacyTypes.GetLegacyType(Dialect, IBDBXLegacyTypes.GetLegacyProviderType(dbType, subType, scale)); ; + row["IsFixedLength"] = IBDBXLegacyTypes.FixedLength.Contains(dbType); + row["IsUnicode"] = false; + row["IsLong"] = false; + row["IsUnsigned"] = IBDBXLegacyTypes.IsLong.Contains(dbType); + row["ORDINAL_POSITION"] = (short)row["ORDINAL_POSITION"] + 1; + } } schema.EndLoadData(); diff --git a/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Schema/IBProcedures.cs b/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Schema/IBProcedures.cs index 8a042f3..2ecffef 100644 --- a/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Schema/IBProcedures.cs +++ b/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Schema/IBProcedures.cs @@ -22,6 +22,8 @@ using System.Data; using System.Globalization; using System.Text; +using InterBaseSql.Data.Common; +using InterBaseSql.Data.InterBaseClient; namespace InterBaseSql.Data.Schema { @@ -80,6 +82,10 @@ protected override StringBuilder GetCommandText(string[] restrictions) protected override DataTable ProcessResult(DataTable schema) { schema.BeginLoadData(); + if (IBDBXLegacyTypes.IncludeLegacySchemaType) + { + schema.Columns.Add("ProcedureType", typeof(string)); + } foreach (DataRow row in schema.Rows) { @@ -100,6 +106,10 @@ protected override DataTable ProcessResult(DataTable schema) { row["IS_SYSTEM_PROCEDURE"] = true; } + if (IBDBXLegacyTypes.IncludeLegacySchemaType) + { + row["ProcedureType"] = "PROCEDURE"; + } } schema.EndLoadData(); diff --git a/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Schema/IBSchema.cs b/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Schema/IBSchema.cs index 89be470..70424a0 100644 --- a/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Schema/IBSchema.cs +++ b/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Schema/IBSchema.cs @@ -40,6 +40,7 @@ internal abstract class IBSchema public DataTable GetSchema(IBConnection connection, string collectionName, string[] restrictions) { + Dialect = connection.DBSQLDialect; var dataTable = new DataTable(collectionName); using (var command = BuildCommand(connection, collectionName, ParseRestrictions(restrictions))) { @@ -71,6 +72,7 @@ protected IBCommand BuildCommand(IBConnection connection, string collectionName, var restriction = connection.GetSchema(DbMetaDataCollectionNames.Restrictions).Select(filter); var transaction = connection.InnerConnection.ActiveTransaction; var command = new IBCommand(builder.ToString(), connection, transaction); + Dialect = connection.DBSQLDialect; if (restrictions != null && restrictions.Length > 0) { @@ -148,6 +150,7 @@ private static void TrimStringFields(DataTable schema) /// The major version of the connected InterBase server /// protected int MajorVersionNumber { get; private set; } + protected short Dialect { get; set; } #endregion } } diff --git a/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Schema/IBSchemaFactory.cs b/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Schema/IBSchemaFactory.cs index 978db2b..d50e800 100644 --- a/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Schema/IBSchemaFactory.cs +++ b/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Schema/IBSchemaFactory.cs @@ -35,6 +35,7 @@ internal sealed class IBSchemaFactory #region Static Members private static readonly string ResourceName = "InterBaseSql.Data.Schema.IBMetaData.xml"; + private static readonly string ResourceName_legacy = "InterBaseSql.Data.Schema.IBMetaData_legacy.xml"; #endregion @@ -52,7 +53,8 @@ public static DataTable GetSchema(IBConnection connection, string collectionName { var filter = string.Format("CollectionName = '{0}'", collectionName); var ds = new DataSet(); - using (var xmlStream = Assembly.GetExecutingAssembly().GetManifestResourceStream(ResourceName)) + string xmlResource = IBDBXLegacyTypes.IncludeLegacySchemaType ? ResourceName_legacy : ResourceName; + using (var xmlStream = Assembly.GetExecutingAssembly().GetManifestResourceStream(xmlResource)) { var oldCulture = Thread.CurrentThread.CurrentCulture; try diff --git a/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Schema/IBTableConstraints.cs b/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Schema/IBTableConstraints.cs index 6691331..01eaeaf 100644 --- a/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Schema/IBTableConstraints.cs +++ b/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Schema/IBTableConstraints.cs @@ -22,6 +22,7 @@ using System.Data; using System.Globalization; using System.Text; +using InterBaseSql.Data.InterBaseClient; namespace InterBaseSql.Data.Schema { @@ -146,7 +147,22 @@ protected override string[] ParseRestrictions(string[] restrictions) return parsed; } + protected override DataTable ProcessResult(DataTable schema) + { + schema.BeginLoadData(); + // not in the Dbx stuff but does cause a mapping of the names to the same thing + // CONSTRAINT_CATALOG and CONSTRAINT_SCHEMA maps do. All 4 columns are null anyways. + if (IBDBXLegacyTypes.IncludeLegacySchemaType) + { + schema.Columns.Remove("TABLE_CATALOG"); + schema.Columns.Remove("TABLE_SCHEMA"); + } + schema.EndLoadData(); + schema.AcceptChanges(); + + return schema; + } #endregion } } diff --git a/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Schema/IBViewColumns.cs b/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Schema/IBViewColumns.cs index c1072d8..dc2845f 100644 --- a/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Schema/IBViewColumns.cs +++ b/NETProvider/Provider/src/InterBaseSql.Data.InterBaseClient/Schema/IBViewColumns.cs @@ -133,7 +133,7 @@ protected override DataTable ProcessResult(DataTable schema) row["IS_NULLABLE"] = (row["COLUMN_NULLABLE"] == DBNull.Value); row["IS_ARRAY"] = (row["COLUMN_ARRAY"] != DBNull.Value); - var dbType = (IBDbType)TypeHelper.GetDbDataTypeFromBlrType(blrType, subType, scale); + var dbType = (IBDbType)TypeHelper.GetDbDataTypeFromBlrType(blrType, subType, scale, Dialect); row["COLUMN_DATA_TYPE"] = TypeHelper.GetDataTypeName((DbDataType)dbType).ToLowerInvariant(); if (dbType == IBDbType.Char || dbType == IBDbType.VarChar) diff --git a/NETProvider/Provider/src/InterBaseSql.EntityFrameworkCore.InterBase.FunctionalTests/InterBaseSql.EntityFrameworkCore.InterBase.FunctionalTests.csproj b/NETProvider/Provider/src/InterBaseSql.EntityFrameworkCore.InterBase.FunctionalTests/InterBaseSql.EntityFrameworkCore.InterBase.FunctionalTests.csproj index 0410fb8..4dcb8ff 100644 --- a/NETProvider/Provider/src/InterBaseSql.EntityFrameworkCore.InterBase.FunctionalTests/InterBaseSql.EntityFrameworkCore.InterBase.FunctionalTests.csproj +++ b/NETProvider/Provider/src/InterBaseSql.EntityFrameworkCore.InterBase.FunctionalTests/InterBaseSql.EntityFrameworkCore.InterBase.FunctionalTests.csproj @@ -13,6 +13,7 @@ + diff --git a/NETProvider/Provider/src/InterBaseSql.EntityFrameworkCore.InterBase.Tests/InterBaseSql.EntityFrameworkCore.InterBase.Tests.csproj b/NETProvider/Provider/src/InterBaseSql.EntityFrameworkCore.InterBase.Tests/InterBaseSql.EntityFrameworkCore.InterBase.Tests.csproj index 9896492..2006b38 100644 --- a/NETProvider/Provider/src/InterBaseSql.EntityFrameworkCore.InterBase.Tests/InterBaseSql.EntityFrameworkCore.InterBase.Tests.csproj +++ b/NETProvider/Provider/src/InterBaseSql.EntityFrameworkCore.InterBase.Tests/InterBaseSql.EntityFrameworkCore.InterBase.Tests.csproj @@ -15,6 +15,7 @@ + diff --git a/NETProvider/Provider/src/InterBaseSql.EntityFrameworkCore.InterBase/InterBaseSql.EntityFrameworkCore.InterBase.csproj b/NETProvider/Provider/src/InterBaseSql.EntityFrameworkCore.InterBase/InterBaseSql.EntityFrameworkCore.InterBase.csproj index 35c76d3..4ee2f60 100644 --- a/NETProvider/Provider/src/InterBaseSql.EntityFrameworkCore.InterBase/InterBaseSql.EntityFrameworkCore.InterBase.csproj +++ b/NETProvider/Provider/src/InterBaseSql.EntityFrameworkCore.InterBase/InterBaseSql.EntityFrameworkCore.InterBase.csproj @@ -10,7 +10,7 @@ NETProvider - Entity Framework Core Provider - (c) 2017-2022 + (c) 2017-2023 InterBaseSql.EntityFrameworkCore.InterBase @@ -44,6 +44,7 @@ + diff --git a/NETProvider/Provider/src/Perf/Perf.csproj b/NETProvider/Provider/src/Perf/Perf.csproj index 234b577..d9821d2 100644 --- a/NETProvider/Provider/src/Perf/Perf.csproj +++ b/NETProvider/Provider/src/Perf/Perf.csproj @@ -6,6 +6,7 @@ + @@ -19,6 +20,6 @@ - + diff --git a/NETProvider/README.md b/NETProvider/README.md index ce253d0..36306a8 100644 --- a/NETProvider/README.md +++ b/NETProvider/README.md @@ -1,5 +1,21 @@ # InterBase .NET Data Provider +# 7.14.6 Summary + +# Fixed MacOS determining and loading code, so should work on MAC both Default and Embedded + +# 7.14.0 Summery (released as part of 7.14.6) + +## Better Code page support. +* if System.Text.Encoding.CodePages can be loaded the ANSI code pages are available when the data's code page is null. Previously high byte characters would fail assuming UTF8 could handle it. +* This might require adding System.Text.Encoding.CodePages.dll to your project on existing projects. + +## Better Dialect 1 support - Returns Double as the data type for SQL_D_DOUBLE types instead of scaled int64 + +## Support for Generating the Schema data that mirrors the old Dbx based ADO.NET driver +* Note that the current ADO.NET driver is not meant to be backwards compatible, but in this instance it was decided to make this portion backwards. +* IBDBXLegacyTypes.IncludeLegacySchemaType added. Default is false, when true outputs schema data like the old DBX based driver did (types, names etc) + More information at the following links: * [Providers](Provider/readme.txt)