Skip to content

Commit

Permalink
v1.0.18b
Browse files Browse the repository at this point in the history
- Changed cursor initialization (should fix #88)
- Fix for "1.0.17/1.0.18 regression: COMMIT and ROLLBACK delete all cursor definitions -> Status -111" (#119)
- Merged pull request #127 (thanks to Simon Sobisch)
  • Loading branch information
mridoni committed Oct 27, 2022
1 parent c86b8cc commit b2030ee
Show file tree
Hide file tree
Showing 90 changed files with 15,688 additions and 26 deletions.
7 changes: 6 additions & 1 deletion ChangeLog
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
=== v1.0.18b =====================================================
- Changed cursor initialization (should fix #88)
- Fix for "1.0.17/1.0.18 regression: COMMIT and ROLLBACK delete all cursor definitions -> Status -111" (#119)
- Merged pull request #127 (thanks to Simon Sobisch)

=== v1.0.18a =====================================================
- Changed logging system initializationto avoid possible crashes
- Changed logging system initialization to avoid possible crashes
- Fixed some spelling problems in the documentation
- Fixed some memory leaks in the runtime
- Solution for "sqlstate by driver may set 00000 for errors (in GixSQL?)" (#114)
Expand Down
16 changes: 9 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -432,15 +432,17 @@ in case you want to to build a 32-bit version.

*All commands and packages refer to Ubuntu 20.04, You might need to adjust them depending on your distribution or environment.*

You will need the development packages for the DBMS client libraries, e.g.:
You will need the development packages for some of the DBMS client libraries, e.g.:

apt install libmariadb-dev libpq-dev unixodbc-dev flex

*(it is still possible to use libmysqlclient-dev, should you prefer it).*

The client support code for Oracle and SQLite is integrated in GixSQL, so no additional package is needed.

Starting from v1.0.16 you will also need the development packages for spdlog and fmt, if not already installed:

apt install ibspdlog-dev libfmt-dev
apt install libspdlog-dev libfmt-dev

You will also need a modern enough version of bison (3.7+). If you do not already have it installed and you are using Ubuntu 20.04, you can download it from Debian's repositories and install it over the current one (or you can download and compile it from [here](https://www.gnu.org/software/bison/).

Expand All @@ -452,20 +454,20 @@ and

Download the .tar.gz.package from the Releases page, e.g.

gixsql-1.0.16-xxxx.tar.gz
gixsql-1.0.18-xxxx.tar.gz

Untar the package:
Untar the package (the package name and verision may obviously vary):

tar xzvf gixsql-1.0.16-641.tar.gz
tar xzvf gixsql-1.0.18b-922.tar.gz

cd to the directory created by the tar command and run configure (in this case we will install to /opt/gixsql)

cd gixsql-1.0.16-641
cd gixsql-1.0.18-922
./configure --prefix=/opt/gixsql

By default configure tries to build all the drivers. If you nly need one, you can disable the others. For instance, to build only the PostgreSQL driver:

./configure --prefix=/opt/install --disable-mysql --disable-odbc
./configure --prefix=/opt/install --disable-mysql --disable-odbc --disable-sqlite ---disable-oracle

If all goes well you can just do:

Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Process this file with autoconf to produce a configure script.

AC_PREREQ([2.69])
AC_INIT([gixsql], [1.0.18a], [[email protected]])
AC_INIT([gixsql], [1.0.18b], [[email protected]])
AC_CONFIG_SRCDIR([config.h.in])
AC_CONFIG_HEADERS([config.h])
AM_INIT_AUTOMAKE([1.9.6 -Wall -Werror dist-bzip2 subdir-objects])
Expand Down
2 changes: 1 addition & 1 deletion deploy/installers/linux/mkdeb-gixsql.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ if [ "$?" != "0" ] ; then echo "Cannot install build" ; exit 1 ; fi

# ********************************

cp -frv $WORKSPACE/gixsql-tests/data/* $PKGDEBDIR/${INSTALL_PREFIX}/share/gixsql/examples
cp -frv $WORKSPACE/gixsql-tests-nunit/data/*.cbl $WORKSPACE/gixsql-tests-nunit/data/*.cpy $WORKSPACE/gixsql-tests-nunit/data/*.sql $PKGDEBDIR/${INSTALL_PREFIX}/share/gixsql/examples
if [ "$?" -ne "0" ] ; then
echo "Error while packaging GixSQL examples"; exit 1
fi
Expand Down
5 changes: 3 additions & 2 deletions deploy/installers/windows/gixsql.iss
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,9 @@ Source: "{#DIST_DIR}\lib\*"; DestDir: "{app}\lib"; Flags: ignoreversion createal
Source: "{#WORKSPACE}\copy\SQLCA.cpy"; DestDir: "{app}\lib\copy"; Flags: ignoreversion createallsubdirs recursesubdirs

; examples and docs
Source: "{#WORKSPACE}\gixsql-tests\data\*.cbl"; DestDir: "{userdocs}\GixSQL\Examples"; Flags: ignoreversion createallsubdirs recursesubdirs onlyifdoesntexist
Source: "{#WORKSPACE}\gixsql-tests\data\*.cpy"; DestDir: "{userdocs}\GixSQL\Examples"; Flags: ignoreversion createallsubdirs recursesubdirs onlyifdoesntexist
Source: "{#WORKSPACE}\gixsql-tests-nunit\data\*.cbl"; DestDir: "{userdocs}\GixSQL\Examples"; Flags: ignoreversion createallsubdirs recursesubdirs onlyifdoesntexist
Source: "{#WORKSPACE}\gixsql-tests-nunit\data\*.cpy"; DestDir: "{userdocs}\GixSQL\Examples"; Flags: ignoreversion createallsubdirs recursesubdirs onlyifdoesntexist
Source: "{#WORKSPACE}\gixsql-tests-nunit\data\*.sql"; DestDir: "{userdocs}\GixSQL\Examples"; Flags: ignoreversion createallsubdirs recursesubdirs onlyifdoesntexist
Source: "{#WORKSPACE}\README"; DestDir: "{userdocs}\GixSQL\Documentation"; Flags: ignoreversion

; MS runtimes
Expand Down
21 changes: 21 additions & 0 deletions gixsql-tests-nunit/CobolSourceAttribute.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace gixsql_tests
{
[AttributeUsage(AttributeTargets.Method, AllowMultiple = true)]
public class CobolSourceAttribute : Attribute
{
public string Module;
public string[] Dependencies;

public CobolSourceAttribute(string m, params string[] d)
{
Module = m;
Dependencies = d;
}
}
}
99 changes: 99 additions & 0 deletions gixsql-tests-nunit/CompilerConfig.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
//using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.IO;
using System.Xml;

namespace gixsql_tests
{

internal class CompilerConfig
{
public string compiler_id { get; private set; }

public string gix_data_dir { get; private set; }
public string gix_bin_path { get; private set; }
public string gix_lib_path { get; private set; }
public string gix_copy_path { get; private set; }

public string cobc_homedir { get; private set; }
public string cobc_bin_dir_path { get; private set; }
public string cobc_lib_dir_path { get; private set; }
public string cobc_config_dir_path { get; private set; }

public string link_lib_dir_path { get; private set; }
public string link_lib_name { get; private set; }
public string link_lib_lname { get; private set; }

public string gixpp_exe { get; private set; }
public string cobc_exe { get; private set; }
public string cobcrun_exe { get; private set; }

public static CompilerConfig init(CompilerType ctype, string configuration, string platform, string build_type)
{
CompilerConfig cc = new CompilerConfig();

string gix_base_path = Environment.GetEnvironmentVariable($"GIX_BASE_PATH_{platform}");

if (ctype == CompilerType.MSVC)
{
cc.compiler_id = Environment.GetEnvironmentVariable("VC_COMPILER_ID");
}
else
{
cc.compiler_id = platform.ToLower() == "x86" ? Environment.GetEnvironmentVariable("MINGW_COMPILER_X86_ID") : Environment.GetEnvironmentVariable("MINGW_COMPILER_X64_ID");
}

string local_app_data = Environment.GetEnvironmentVariable("LOCALAPPDATA");
cc.gix_data_dir = Path.Combine(local_app_data, "Gix");

string cdef_file = Path.Combine(cc.gix_data_dir, "compiler-defs", cc.compiler_id + ".def");
Assert.IsTrue(File.Exists(cdef_file));

XmlDocument xdef = new XmlDocument();
Assert.IsNotNull(xdef);
xdef.Load(cdef_file);

XmlElement xh = (XmlElement)xdef.SelectSingleNode($"//homedir");
Assert.IsNotNull(xh);
cc.cobc_homedir = xh.InnerText;

XmlElement xp = (XmlElement)xdef.SelectSingleNode($"//platform[@id=\"{platform}\"]");
Assert.IsNotNull(xp);

cc.cobc_bin_dir_path = xp.SelectSingleNode("bin_dir_path")?.InnerText;
cc.cobc_bin_dir_path = cc.cobc_bin_dir_path.Replace("${homedir}", cc.cobc_homedir).Replace("${gixdata}", cc.gix_data_dir);
Assert.IsTrue(Directory.Exists(cc.cobc_bin_dir_path));

cc.cobc_lib_dir_path = xp.SelectSingleNode("lib_dir_path")?.InnerText;
cc.cobc_lib_dir_path = cc.cobc_lib_dir_path.Replace("${homedir}", cc.cobc_homedir).Replace("${gixdata}", cc.gix_data_dir);
Assert.IsTrue(Directory.Exists(cc.cobc_lib_dir_path));

cc.cobc_config_dir_path = xp.SelectSingleNode("config_dir_path")?.InnerText;
cc.cobc_config_dir_path = cc.cobc_config_dir_path.Replace("${homedir}", cc.cobc_homedir).Replace("${gixdata}", cc.gix_data_dir);
Assert.IsTrue(Directory.Exists(cc.cobc_config_dir_path));

cc.gix_copy_path = Path.Combine(gix_base_path, "lib", "copy");
Assert.IsTrue(Directory.Exists(cc.gix_copy_path));
Assert.IsTrue(File.Exists(Path.Combine(cc.gix_copy_path, "SQLCA.cpy")));

cc.gix_bin_path = Path.Combine(gix_base_path, "bin");
cc.gix_lib_path = Path.Combine(gix_base_path, "lib");
cc.link_lib_dir_path = Path.Combine(cc.gix_lib_path, platform, (ctype == CompilerType.MSVC ? "msvc" : "gcc"));
cc.link_lib_name = ctype == CompilerType.MSVC ? "libgixsql.lib" : "libgixsql.a";
Assert.IsTrue(File.Exists(Path.Combine(cc.link_lib_dir_path, cc.link_lib_name)));

cc.gixpp_exe = Path.Combine(cc.gix_bin_path, "gixpp.exe");
Assert.IsTrue(File.Exists(cc.gixpp_exe));

cc.cobc_exe = Path.Combine(cc.cobc_bin_dir_path, "cobc.exe");
Assert.IsTrue(File.Exists(cc.cobc_exe));

cc.cobcrun_exe = Path.Combine(cc.cobc_bin_dir_path, "cobcrun.exe");
Assert.IsTrue(File.Exists(cc.cobcrun_exe));

cc.link_lib_lname = ctype == CompilerType.MSVC ? "libgixsql" : "gixsql";

return cc;
}
}
}
101 changes: 101 additions & 0 deletions gixsql-tests-nunit/CompilerConfig2.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
//using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.IO;
using System.Xml;

namespace gixsql_tests
{

public class CompilerConfig2
{
public string compiler_id { get; set; }

public string gix_data_dir { get; set; }
public string gix_bin_path { get; set; }
public string gix_lib_path { get; set; }
public string gix_copy_path { get; set; }

public string cobc_homedir { get; set; }
public string cobc_bin_dir_path { get; set; }
public string cobc_lib_dir_path { get; set; }
public string cobc_config_dir_path { get; set; }

public string link_lib_dir_path { get; set; }
public string link_lib_name { get; set; }
public string link_lib_lname { get; set; }

public string gixpp_exe { get; set; }
public string cobc_exe { get; set; }
public string cobcrun_exe { get; set; }
public bool IsVsBased { get; set; }

public static CompilerConfig2 init(string ctype, string architecture, string c_id)
{
try
{
CompilerConfig2 cc = new CompilerConfig2();

string gix_base_path = Environment.GetEnvironmentVariable("GIXSQL_INSTALL_BASE");

cc.compiler_id = c_id;

string local_app_data = Environment.GetEnvironmentVariable("LOCALAPPDATA");
cc.gix_data_dir = Path.Combine(local_app_data, "Gix");

string cdef_file = Path.Combine(cc.gix_data_dir, "compiler-defs", cc.compiler_id + ".def");
if (!File.Exists(cdef_file)) throw new Exception(cdef_file); ;

XmlDocument xdef = new XmlDocument();
xdef.Load(cdef_file);

XmlElement xh = (XmlElement)xdef.SelectSingleNode($"//homedir");
cc.cobc_homedir = xh.InnerText;

XmlElement xp = (XmlElement)xdef.SelectSingleNode($"//platform[@id=\"{architecture}\"]");

XmlElement xv = (XmlElement)xdef.SelectSingleNode($"//is_vs_based");
cc.IsVsBased = Boolean.Parse(xv.InnerText);

cc.cobc_bin_dir_path = xp.SelectSingleNode("bin_dir_path")?.InnerText;
cc.cobc_bin_dir_path = cc.cobc_bin_dir_path.Replace("${homedir}", cc.cobc_homedir).Replace("${gixdata}", cc.gix_data_dir);
if (!Directory.Exists(cc.cobc_bin_dir_path)) throw new Exception(cc.cobc_bin_dir_path);

cc.cobc_lib_dir_path = xp.SelectSingleNode("lib_dir_path")?.InnerText;
cc.cobc_lib_dir_path = cc.cobc_lib_dir_path.Replace("${homedir}", cc.cobc_homedir).Replace("${gixdata}", cc.gix_data_dir);
if (!Directory.Exists(cc.cobc_lib_dir_path)) throw new Exception(cc.cobc_lib_dir_path);

cc.cobc_config_dir_path = xp.SelectSingleNode("config_dir_path")?.InnerText;
cc.cobc_config_dir_path = cc.cobc_config_dir_path.Replace("${homedir}", cc.cobc_homedir).Replace("${gixdata}", cc.gix_data_dir);
if (!Directory.Exists(cc.cobc_config_dir_path)) throw new Exception(cc.cobc_config_dir_path);

cc.gix_copy_path = Path.Combine(gix_base_path, "lib", "copy");
if (!Directory.Exists(cc.gix_copy_path)) throw new Exception(cc.gix_copy_path);
if (!File.Exists(Path.Combine(cc.gix_copy_path, "SQLCA.cpy"))) throw new Exception();

cc.gix_bin_path = Path.Combine(gix_base_path, "bin");
cc.gix_lib_path = Path.Combine(gix_base_path, "lib");
cc.link_lib_dir_path = Path.Combine(cc.gix_lib_path, architecture, ctype);
cc.link_lib_name = cc.IsVsBased ? "libgixsql.lib" : "libgixsql.a";
if (!File.Exists(Path.Combine(cc.link_lib_dir_path, cc.link_lib_name))) throw new Exception(Path.Combine(cc.link_lib_dir_path, cc.link_lib_name));

cc.gixpp_exe = Path.Combine(cc.gix_bin_path, "gixpp.exe");
if (!File.Exists(cc.gixpp_exe)) throw new Exception(cc.gixpp_exe);

cc.cobc_exe = Path.Combine(cc.cobc_bin_dir_path, "cobc.exe");
if (!File.Exists(cc.cobc_exe)) throw new Exception(cc.cobc_exe);

cc.cobcrun_exe = Path.Combine(cc.cobc_bin_dir_path, "cobcrun.exe");
if (!File.Exists(cc.cobcrun_exe)) throw new Exception(cc.cobcrun_exe);

cc.link_lib_lname = cc.IsVsBased ? "libgixsql" : "gixsql";

return cc;
}
catch (Exception ex)
{
Console.WriteLine(ex.Message + "\n" + ex.StackTrace);
throw ex;
}
}
}
}
8 changes: 8 additions & 0 deletions gixsql-tests-nunit/CompilerType.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
namespace gixsql_tests
{
public enum CompilerType
{
MSVC,
MinGW
}
}
21 changes: 21 additions & 0 deletions gixsql-tests-nunit/GixSqlDataSourceAttribute.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace gixsql_tests
{
[AttributeUsage(AttributeTargets.Method, AllowMultiple = true)]
public class GixSqlDataSourceAttribute : Attribute
{
public string type;
public int index;

public GixSqlDataSourceAttribute(string t, int i)
{
type = t;
index = i;
}
}
}
Loading

0 comments on commit b2030ee

Please sign in to comment.