Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue while adding a new database to HammerDB #433

Closed
mariadb-DmitryVolkov opened this issue Sep 21, 2022 · 4 comments
Closed

Issue while adding a new database to HammerDB #433

mariadb-DmitryVolkov opened this issue Sep 21, 2022 · 4 comments

Comments

@mariadb-DmitryVolkov
Copy link

I want to add a new database MariaDB Xpand to the hammerdb. As you may guess, this is mysql/mariadb compatible database and I was hoping to simple re-use mariatcl library.

So far, I've modified database.xml and added xpand.xml under the config directory. You can see changes in my fork: https://github.com/mariadb-DmitryVolkov/HammerDB

In addition, I've added expand directory under src folder

It seems consistent with what described in here: https://www.hammerdb.com/blog/uncategorized/how-to-add-your-database-to-hammerdb-pt3-adding-to-and-modifying-the-source/

Then I've run ./Build-Linux.sh x64 Setup/HammerDB-Linux.bawt update

Now I see:
./hammerdbcli HammerDB CLI v4.5 Copyright (C) 2003-2022 Steve Shaw Type "help" for a list of commands Error loading database source files/mariadb/xpandopt.tcl Error loading database source files/mariadb/xpandoltp.tcl Error loading database source files/mariadb/xpandolap.tcl Error loading database source files/mariadb/xpandotc.tcl

and maria seems disappears from the list of databases. What I am missing?

@mariadb-DmitryVolkov
Copy link
Author

Blog post mentioned:
In this case as MariaDB is a fork of MySQL and the workloads are so close we are going to copy all of the required files from the MySQL directory, rename them and update the variable and procedure names from mysql to mariadb.

Do I really need to do the same even if I want to fully re-use an existing library?

@mariadb-DmitryVolkov
Copy link
Author

Turns out that the culprit was that the blog post has never been updated for the new sqllite functionality. Nowadays, any changes in XML files will not be reflected as hammerdbcli read config from sqlite db.

@sm-shaw
Copy link
Contributor

sm-shaw commented Sep 22, 2022

Hi, Yes I'm afraid this blog post is a little out of date.

The key question at the outset is how similar MariaDB Xpand is to MariaDB Enterprise Server? If they are similar (or intended to converge over time) and most of the workloads and the interface are the same, then the best approach is to add Xpand to HammerDB as an extension of the existing MariaDB support - an example already done is here #302 where the PostgreSQL Citus Data extension support was added to the existing PostgreSQL workload and then selected as a checkbox/CLI option.

If it is a substantially different database needing a different interface, then adding as a separate database may be the best option. The fork of mariatcl that is downloaded when you build from source is here https://github.com/sm-shaw/mariatcl. As can be seen this is simply a wrapper around the MariaDB C API so easily modified.

With the HammerDB source there is essentially 2 levels, firstly when you build from source this is downloading and building all of the dependencies written in C (supporting both Linux and Windows) so if modifying the mariatcl interface this "build from source" is what you would use to build the modified library. This "build from source" creates everything you see in the HammerDB "bin" & "lib" directories (and include) and copies the source in "src" to create the build.

If adding a new database or modifying an existing workload then you can modify the source in the "src" directory and this does not need be to be built as this gets compiled into bytecode at runtime. So when doing this, you can take an existing build of HammerDB 4.5 (or build from source for all of the latest changes) and go straight in and add/modify the source in the "src" directory and then run HammerDB without recompiling and you will see your changes.

Yes now from 4.5 there is a series of SQLite .db files that store the last known configuration, so this is persisted across restarts. If you want to re-read from the XML you can delete the .db files and they will be recreated.

@sm-shaw
Copy link
Contributor

sm-shaw commented Nov 3, 2023

Closed as MariaDB have stopped developing Xpand.

@sm-shaw sm-shaw closed this as not planned Won't fix, can't repro, duplicate, stale Nov 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants