Coding for Google Summer of Code 2016 has officially start and so lets start building our filter.
I have forked and cloned the Maxscale 1.4.3 branch which I will be basing my work on in creating the filter this summer. I have also created a new branch called MXS-1 to correspond with the jira task to which I will be comitting my changes.
But first Lets write down some test queries that won’t work on MariaDB/MySQL but run on MS Server to highlight the differences between the two syntaxes.
Basically, MS Server syntax is very similar to MariaDB syntax but allows from some additional clauses which MariaDB does not support. This allows for many possible queries with different syntax that can be written for MS SQL Server and which will not work on MariaDB.
The select Query has a very complex syntax but we will limit our scope for now to the basic select queries below which are guaranteed to fail on MariaDB but run on MS SQL Server.
SELECT TOP 10 * FROM TestTable WHERE id=12;
SELECT (‘MS’ + ‘SQL’ + ‘Tips’)
SELECT * from [tablename];
SELECT * FROM FactResellerSales OPTION ( LABEL = ‘q17’ );
INSERT top(5) INTO tTable1 SELECT * FROM tTable2;
Also, we will need a MS SQL server instance running on a windows server so we can test our queries. Virtual machine images can be downloaded Here.
Extract the zip file downloaded to get the .ova file bundled in it.
Now start virtualbox,
go to File -> Import Appliance in the menu bar.
Click the “Open Appliance” button to select your OVA file. Once you have selected the file, click “Next”.
The next window will show you the configuration of the current virtual appliance. You can scroll through the configuration list and double click on any item (or check/uncheck the box) to make changes to it. Lastly, click “Import”.
Now we have our virtual machine up in virtualbox and we can go ahead and start it.