# dbConnect mSQL database example(s) and testing tables
# Copyright (C) 2003 Johnathan Ingram, jingram@rogueware.org
#
# This library is free software; you can redistribute it and/or
#   modify it under the terms of the GNU Lesser General Public
#   License as published by the Free Software Foundation; either
#   version 2.1 of the License, or (at your option) any later version.
#
#   This library is distributed in the hope that it will be useful,
#   but WITHOUT ANY WARRANTY; without even the implied warranty of
#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
#   Lesser General Public License for more details.
#
#   You should have received a copy of the GNU Lesser General Public
#   License along with this library; if not, write to the Free Software
#   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  US
#
#   Note: To create execute `cat tables.sql | msql -h localhost dbconnectDB`
#
DROP INDEX tyt1 FROM TypeTest
\g

DROP TABLE TypeTest
\g

CREATE TABLE TypeTest
( 
  id                      INT NOT NULL,
  description             CHAR(100) NOT NULL,
  
  t_INT                   INT,
  t_UINT                  UINT,
  t_INT8                  INT8,
  t_UINT8                 UINT8,
  t_INT16                 INT16,
  t_UINT16                UINT16,
  t_INT32                 INT32,
  t_UINT32                UINT32,
  t_INT64                 INT64,
  t_UINT64                UINT64,

  t_REAL                  REAL,
  t_MONEY                 MONEY,

  t_DATE                  DATE,
  t_TIME                  TIME,

  t_CHAR                  CHAR(100),
  t_IPV4                  IPV4,

  t_TEXT                  TEXT(1024)
)
\g

CREATE UNIQUE INDEX tyt1 ON TypeTest(id)
\g

INSERT INTO TypeTest 
   (id, description, t_INT, t_UINT, t_INT8, t_UINT8, t_INT16, t_UINT16, t_INT32, t_UINT32, t_INT64, t_UINT64)
VALUES
   (1, '1: Integer Types', -32767, 65535, -127, 255, -32767, 65535, -2147483647, 4294967295, -9223372036854775807, 18446744073709551615)
\g

INSERT INTO TypeTest 
   (id, description, t_REAL, t_MONEY)
VALUES
   (2, '2: Float & Money Types', -1.7976931348623157E+308, 80359.56)
\g

INSERT INTO TypeTest 
   (id, description, t_DATE, t_TIME)
VALUES
   (3, '3: Date & Time Types', '21-Jan-2003', '15:34:59')
\g

INSERT INTO TypeTest 
   (id, description, t_CHAR, t_IPV4)
VALUES
   (4, '4: String and IP Types', 'This is a char', '192.168.8.1')
\g

INSERT INTO TypeTest 
   (id, description, t_TEXT)
VALUES
(5, '5: Text / Binary Types', 'This is a text type thingy. Test \\<-- Is a backslash')
\g
