MariaDB is a copy-like version of mySQL, so it is almost plug and play for systems which are mySQL ready.
Nevertheless, the download of the server and the C++ connector must be done from another source.
First you need to install the MariaDB SQL server.
Go to
mariadb.com and install the Community (free) server.
Then select Connectors tab (in the MariaDB website) and download the Connector C (version 32 or 64 bits according to the library you intend to use with vsTASKER. You can download both if you plan to use both version. vsTASKER will select the correct one according to the compiler setting)
Now install the SQL server and the C connector.
Follow the MariaDB installation procedure.
Now, set the following environment variable: MARIADB_C_DIR to C:\Program Files (x86)\MariaDB\MariaDB Connector C
|
The x64 version of MariaDB Connector C can also be used to compile with x64 libs of vsTASKER. In such case, the environment variable should be set accordingly:
MARIADB_C_DIR to C:\Program Files\MariaDB\MariaDB Connector C 64-bits
|
To test the test_mariadb sample, you need to create a session.
Open HeidiSQL.
Name the session whatever you want, and give the root password you setup on the server side. Select the database demo:
Then, open the session (and the database demo) and add the following request to create the Initial table:
DROP TABLE IF EXISTS `initial`;
CREATE TABLE `initial` (
`Name` varchar(45) NOT NULL,
`Latitude` decimal(10,0) DEFAULT NULL,
`Longitude` decimal(10,0) DEFAULT NULL,
`WhereToGo` varchar(5) DEFAULT NULL,
`Speed` decimal(10,0) DEFAULT NULL
);
|
Then, with the following request, fill the table with entity position entries:
INSERT INTO `initial` VALUES ('ent1',-80,-70,'A',5),('ent2',-60,100,'B',8),('ent3',50,80,'C',3),('ent4',10,-90,'D',6);
|
Now, start vsTASKER, open the SQL/test_mariadb database, and setup the SQL server:
the generated code will create a session on the localhost, under user root and password.
The associated database (name) is here demo (Schema name)
Compile the database and start the simulation.
You should see four entities starting at various positions on the map. These positions have been extracted from the Initial table.
vsTASKER will create two tables: entity and result.
You can see them on HeidiSQL client once the simulation ends (you need to refresh or start a new session to see these tables).
Now, you can have a look at the tables, how they are defined, and the logics, for how to read data from and save data to tables.