Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
 
 
 
 
 

129 righe
3.9 KiB

  1. DROP DATABASE IF EXISTS `test001`;
  2. CREATE DATABASE `test001`;
  3. USE `test001`;
  4. DROP TABLE IF EXISTS `test000`;
  5. CREATE TABLE `test000` (
  6. `id` int,
  7. `col01` bit(6) DEFAULT NULL,
  8. `col02` tinyint(4) DEFAULT NULL,
  9. `col03` tinyint(4) UNSIGNED DEFAULT NULL,
  10. `col10` bigint DEFAULT NULL,
  11. `col11` bigint UNSIGNED DEFAULT NULL,
  12. `col15` double DEFAULT NULL,
  13. `col27` varchar(6) DEFAULT NULL
  14. );
  15. INSERT INTO `test000` VALUES (1,0x21,-128,255,-9223372036854775808,18446744073709551615,-2.2250738585072014e-308,'0abcde');
  16. DROP TABLE IF EXISTS `test001`;
  17. CREATE TABLE `test001` (
  18. `id` int,
  19. `col` bit(1) DEFAULT NULL
  20. );
  21. INSERT INTO `test001` VALUES (1,NULL);
  22. INSERT INTO `test001` VALUES (2,0x00);
  23. INSERT INTO `test001` VALUES (3,0x01);
  24. DROP TABLE IF EXISTS `test002`;
  25. CREATE TABLE `test002` (
  26. `id` int,
  27. `col` tinyint(4) DEFAULT NULL
  28. );
  29. INSERT INTO `test002` VALUES (1,NULL);
  30. INSERT INTO `test002` VALUES (2,-128);
  31. INSERT INTO `test002` VALUES (3,0);
  32. INSERT INTO `test002` VALUES (4,127);
  33. DROP TABLE IF EXISTS `test003`;
  34. CREATE TABLE `test003` (
  35. `id` int,
  36. `col` tinyint(4) UNSIGNED DEFAULT NULL
  37. );
  38. INSERT INTO `test003` VALUES (1,NULL);
  39. INSERT INTO `test003` VALUES (2,0);
  40. INSERT INTO `test003` VALUES (3,255);
  41. DROP TABLE IF EXISTS `test010`;
  42. CREATE TABLE `test010` (
  43. `id` int,
  44. `col` bigint DEFAULT NULL
  45. );
  46. INSERT INTO `test010` VALUES (1,NULL);
  47. INSERT INTO `test010` VALUES (2,-9223372036854775808);
  48. INSERT INTO `test010` VALUES (3,0);
  49. INSERT INTO `test010` VALUES (4,9223372036854775807);
  50. DROP TABLE IF EXISTS `test011`;
  51. CREATE TABLE `test011` (
  52. `id` int,
  53. `col` bigint UNSIGNED DEFAULT NULL
  54. );
  55. INSERT INTO `test011` VALUES (1,NULL);
  56. INSERT INTO `test011` VALUES (3,0);
  57. INSERT INTO `test011` VALUES (4,18446744073709551615);
  58. DROP TABLE IF EXISTS `test015`;
  59. CREATE TABLE `test015` (
  60. `id` int,
  61. `col` double DEFAULT NULL
  62. );
  63. INSERT INTO `test015` VALUES (1,NULL);
  64. INSERT INTO `test015` VALUES (2,-1.7976931348623157e308);
  65. INSERT INTO `test015` VALUES (3,-2.2250738585072014e-308);
  66. INSERT INTO `test015` VALUES (4,0);
  67. INSERT INTO `test015` VALUES (5,2.2250738585072014e-308);
  68. INSERT INTO `test015` VALUES (6,1.7976931348623157e308);
  69. DROP TABLE IF EXISTS `test027`;
  70. CREATE TABLE `test027` (
  71. `id` int,
  72. `col` varchar(6) DEFAULT NULL
  73. );
  74. INSERT INTO `test027` VALUES (1,NULL);
  75. INSERT INTO `test027` VALUES (2,'');
  76. INSERT INTO `test027` VALUES (3,'0');
  77. INSERT INTO `test027` VALUES (4,'2e308');
  78. INSERT INTO `test027` VALUES (5,'999.99');
  79. INSERT INTO `test027` VALUES (6,'-2e-30');
  80. INSERT INTO `test027` VALUES (7,'-99.99');
  81. INSERT INTO `test027` VALUES (8,'0');
  82. INSERT INTO `test027` VALUES (9,'0abcde');
  83. INSERT INTO `test027` VALUES (10,'123');
  84. DROP TABLE IF EXISTS `test029`;
  85. CREATE TABLE `test029` (
  86. `id` int,
  87. `col` blob NOT NULL
  88. );
  89. INSERT INTO `test029` VALUES (1,0x00010203040506070809909192939495969798A9);
  90. INSERT INTO `test029` VALUES (2,'');
  91. DROP TABLE IF EXISTS `test033`;
  92. CREATE TABLE `test033` (
  93. `id` int,
  94. `col` text NOT NULL
  95. );
  96. INSERT INTO `test033` VALUES (1,'test test test');
  97. DROP VIEW IF EXISTS `test100`;
  98. CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `test100` AS select `test000`.`id` AS `id`,`test000`.`col01` AS `col01`,`test000`.`col02` AS `col02`,`test000`.`col03` AS `col03`,`test000`.`col10` AS `col10`,`test000`.`col11` AS `col11`,`test000`.`col15` AS `col15`,`test000`.`col27` AS `col27` from `test000`;
  99. DROP VIEW IF EXISTS `test127`;
  100. CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `test127` AS select `test027`.`id` AS `id`,`test027`.`col` AS `col` from `test027`;
  101. DROP TABLE IF EXISTS `test200`;
  102. CREATE TABLE `test200` (
  103. `id` int,
  104. `col` tinyint(4) DEFAULT NULL
  105. );
  106. CREATE TRIGGER before_test200_insert
  107. BEFORE insert ON `test200`
  108. FOR EACH ROW set NEW.col = NEW.col + 1;
  109. -- INSERT INTO `test200` VALUES (1,1); -- trigger tests