M
M
m4f12020-03-01 16:23:11
MySQL
m4f1, 2020-03-01 16:23:11

Mysql mariadb where is the error?

Good afternoon, please help me fix an error in a database query, mariadb is hosted, and it swears at a sql query from another system (rather normal mysql).

The request itself:

CREATE TABLE `towers` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `user_id` int(11) NOT NULL,
  `bet` double(255,2) NOT NULL,
  `bombs` int(11) NOT NULL,
  `currency` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `field` json NOT NULL,
  `revealed` json NOT NULL,
  `coeff` double(255,2) NOT NULL DEFAULT '0.00',
  `status` int(11) NOT NULL DEFAULT '0',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


Mistake:
#1064 - У вас ошибка в запросе. Изучите документацию по используемой версии MariaDB на предмет корректного синтаксиса около 'json NOT NULL,
  `revealed` json NOT NULL,
  `coeff` double(255,2) NOT NULL DE' на строке 11

Answer the question

In order to leave comments, you need to log in

2 answer(s)
B
Berkutman, 2020-03-01
@m4f1

MariaDB 10.2 supported JSON. (Alpha version. Not recommended by Maria to production server. Only testing.)
MariaDB 10.1 do not support JSON
Check the version of mariadb on your hosting.

D
d-stream, 2020-03-01
@d-stream

I don’t know about mariadb at all,
but varchar can have default 'something literal (in quotes)'
and int, double must still have values ​​of the corresponding types, not strings of characters

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question