mysql Documentation Appendix D (Porting mSQL applications to mysql)

Documentation Version: 0.80
mysql Version: 3.20.16
Porting mSQL applications to mysql should be relatively easy.

 First, Run the shell script msql2mysql over your source. This needs the binary program replace, which is distributed with mysql. This will translate mSQL function names to mysql. It will NOT fix parameter types or change the number of parameters in mysql functions that need additional parameters.

 Other Hints:

mysql comes with ported versions of the mSQL test programs insert_test.c and select_test.c. It's a good idea to compare these with their mSQL equivalents. This should give you a good start on understanding what you will need to do to port a mSQL application to mysql. It will also give you some hints on what you need to do to write a mysql application.

How does the mysql client/server protocol differ from mSQL?

There are significant differences. Amongst them are...

Differences between msql 2.0b1 and mysql

  mysql: Has the following field option types:
         Has DEFAULT on not null fields.

- To create indexes:
  mysql:  All indexes have to be given at CREATE TABLE.
  mSQL:   Indexes must be created by a separate CREATE INDEX clause.
          (Does mSQL use a new key file for each index?)
          Indexes may be dropped with DROP INDEX

- To get a unique identifier at insert:
  mysql: Use 'auto_increment' as a column type specifier.
         The used index may be retrieved after update by the API
         function mysql_insert_id().
  mSQL:  Create a SEQUENCE on a table and use the __seq function
         to get a unique index.

- Group functions:
  mysql: count(), avg(), min(), max() and sum().  min() and max() may
         take string arguments. count(*) is optimized to return directly
         if no other column is used.
  mSQL:  none

- searching case-independent:
  mysql: LIKE is always case independent. If possible mysql uses indexes
         if the like argument doesn't start with a wild-card.
  mSQL:  Use CLIKE.

- searching with regular expressions.
  mysql: Use REGEXP or RLIKE
  mSQL:  Use RLIKE.

- What is the difference in the WHERE statement:
  mysql has braces, Soon it will have full function support in the WHERE.

- Qualifying column names:
  mysql: If a column name is unique you don't have to use the full qualifier.
  mSQL:  When using more than one table in a select you must use full
         table qualifiers.

- Aliasing
  mysql: Has table and column aliasing.
  mSQL:  Has table aliasing.

- Insert/update with calculations.
  mysql: Full calculation support. In an insert you may use values of preceding
  mSQL:  Only insert update with constants.

- Which formulas may be used in the select statement.
  mysql: To many to print here. Check the manual.
  mSQL:  none

  mysql: Supported, but can only use calculation on the selected fields.
         To select on a calculated value one must use a column alias.
         Ex: SELECT COUNT(*) AS id_count,id FROM groups GROUP BY id HAVING
             id_count > 10
  mSQL:  Not supported