[v11.0.x] MySQL: snapshot tests (#86184)
MySQL: snapshot tests (#84846)
mysql: add snapshot tests
(cherry picked from commit 3b7ee3a56b)
Co-authored-by: Gábor Farkas <gabor.farkas@gmail.com>
This commit is contained in:
committed by
GitHub
parent
bce6d445e9
commit
708ba6f3ac
@@ -0,0 +1,36 @@
|
||||
// 🌟 This was machine generated. Do not edit. 🌟
|
||||
//
|
||||
// Frame[0] {
|
||||
// "typeVersion": [
|
||||
// 0,
|
||||
// 0
|
||||
// ],
|
||||
// "executedQueryString": "SELECT * FROM tbl WHERE false"
|
||||
// }
|
||||
// Name:
|
||||
// Dimensions: 0 Fields by 0 Rows
|
||||
// +
|
||||
// +
|
||||
//
|
||||
//
|
||||
// 🌟 This was machine generated. Do not edit. 🌟
|
||||
{
|
||||
"status": 200,
|
||||
"frames": [
|
||||
{
|
||||
"schema": {
|
||||
"meta": {
|
||||
"typeVersion": [
|
||||
0,
|
||||
0
|
||||
],
|
||||
"executedQueryString": "SELECT * FROM tbl WHERE false"
|
||||
},
|
||||
"fields": []
|
||||
},
|
||||
"data": {
|
||||
"values": []
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
-- SELECT * FROM tbl WHERE false
|
||||
CREATE TABLE tbl (
|
||||
`time` timestamp NOT NULL,
|
||||
v double precision,
|
||||
c text
|
||||
);
|
||||
|
||||
INSERT INTO tbl (`time`, v, c) VALUES
|
||||
('2023-12-24 14:30:03+00:00', 10, 'a'),
|
||||
('2023-12-24 14:30:03+00:00', 110, 'b'),
|
||||
('2023-12-24 14:31:03+00:00', 20, 'a'),
|
||||
('2023-12-24 14:31:03+00:00', 120, 'b');
|
||||
+112
@@ -0,0 +1,112 @@
|
||||
// 🌟 This was machine generated. Do not edit. 🌟
|
||||
//
|
||||
// Frame[0] {
|
||||
// "typeVersion": [
|
||||
// 0,
|
||||
// 0
|
||||
// ],
|
||||
// "executedQueryString": "SELECT * FROM tbl"
|
||||
// }
|
||||
// Name:
|
||||
// Dimensions: 3 Fields by 10 Rows
|
||||
// +-------------------------------+------------------+-----------------+
|
||||
// | Name: time | Name: v | Name: c |
|
||||
// | Labels: | Labels: | Labels: |
|
||||
// | Type: []*time.Time | Type: []*float64 | Type: []*string |
|
||||
// +-------------------------------+------------------+-----------------+
|
||||
// | 2023-12-24 14:30:03 +0000 UTC | 10 | a |
|
||||
// | 2023-12-24 14:30:03 +0000 UTC | 110 | b |
|
||||
// | 2023-12-24 14:31:03 +0000 UTC | 20 | a |
|
||||
// | 2023-12-24 14:31:03 +0000 UTC | 120 | b |
|
||||
// | 2023-12-24 14:32:03 +0000 UTC | 30 | a |
|
||||
// | 2023-12-24 14:32:03 +0000 UTC | 130 | b |
|
||||
// | 2023-12-24 14:33:03 +0000 UTC | 40 | a |
|
||||
// | 2023-12-24 14:33:03 +0000 UTC | 140 | b |
|
||||
// | 2023-12-24 14:34:03 +0000 UTC | 50 | a |
|
||||
// | 2023-12-24 14:34:03 +0000 UTC | 150 | b |
|
||||
// +-------------------------------+------------------+-----------------+
|
||||
//
|
||||
//
|
||||
// 🌟 This was machine generated. Do not edit. 🌟
|
||||
{
|
||||
"status": 200,
|
||||
"frames": [
|
||||
{
|
||||
"schema": {
|
||||
"meta": {
|
||||
"typeVersion": [
|
||||
0,
|
||||
0
|
||||
],
|
||||
"executedQueryString": "SELECT * FROM tbl"
|
||||
},
|
||||
"fields": [
|
||||
{
|
||||
"name": "time",
|
||||
"type": "time",
|
||||
"typeInfo": {
|
||||
"frame": "time.Time",
|
||||
"nullable": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "v",
|
||||
"type": "number",
|
||||
"typeInfo": {
|
||||
"frame": "float64",
|
||||
"nullable": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "c",
|
||||
"type": "string",
|
||||
"typeInfo": {
|
||||
"frame": "string",
|
||||
"nullable": true
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"data": {
|
||||
"values": [
|
||||
[
|
||||
1703428203000,
|
||||
1703428203000,
|
||||
1703428263000,
|
||||
1703428263000,
|
||||
1703428323000,
|
||||
1703428323000,
|
||||
1703428383000,
|
||||
1703428383000,
|
||||
1703428443000,
|
||||
1703428443000
|
||||
],
|
||||
[
|
||||
10,
|
||||
110,
|
||||
20,
|
||||
120,
|
||||
30,
|
||||
130,
|
||||
40,
|
||||
140,
|
||||
50,
|
||||
150
|
||||
],
|
||||
[
|
||||
"a",
|
||||
"b",
|
||||
"a",
|
||||
"b",
|
||||
"a",
|
||||
"b",
|
||||
"a",
|
||||
"b",
|
||||
"a",
|
||||
"b"
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
-- SELECT * FROM tbl
|
||||
CREATE TABLE tbl (
|
||||
`time` timestamp NOT NULL,
|
||||
v double precision,
|
||||
c text
|
||||
);
|
||||
|
||||
INSERT INTO tbl (`time`, v, c) VALUES
|
||||
('2023-12-24 14:30:03+00:00', 10, 'a'),
|
||||
('2023-12-24 14:30:03+00:00', 110, 'b'),
|
||||
('2023-12-24 14:31:03+00:00', 20, 'a'),
|
||||
('2023-12-24 14:31:03+00:00', 120, 'b'),
|
||||
('2023-12-24 14:32:03+00:00', 30, 'a'),
|
||||
('2023-12-24 14:32:03+00:00', 130, 'b'),
|
||||
('2023-12-24 14:33:03+00:00', 40, 'a'),
|
||||
('2023-12-24 14:33:03+00:00', 140, 'b'),
|
||||
('2023-12-24 14:34:03+00:00', 50, 'a'),
|
||||
('2023-12-24 14:34:03+00:00', 150, 'b');
|
||||
@@ -0,0 +1,113 @@
|
||||
// 🌟 This was machine generated. Do not edit. 🌟
|
||||
//
|
||||
// Frame[0] {
|
||||
// "typeVersion": [
|
||||
// 0,
|
||||
// 0
|
||||
// ],
|
||||
// "executedQueryString": "SELECT * FROM tbl"
|
||||
// }
|
||||
// Name:
|
||||
// Dimensions: 4 Fields by 4 Rows
|
||||
// +--------------------------------------+-----------------------------------+---------------------+-----------------------------------+
|
||||
// | Name: reallyt | Name: time | Name: n | Name: timeend |
|
||||
// | Labels: | Labels: | Labels: | Labels: |
|
||||
// | Type: []*time.Time | Type: []*time.Time | Type: []*int64 | Type: []*time.Time |
|
||||
// +--------------------------------------+-----------------------------------+---------------------+-----------------------------------+
|
||||
// | 2023-12-21 12:21:27 +0000 UTC | 2023-12-21 12:21:27 +0000 UTC | 1703161287 | 2023-12-21 12:21:52 +0000 UTC |
|
||||
// | 2023-12-21 12:21:27.724 +0000 UTC | 2023-12-21 12:21:27.724 +0000 UTC | 1703161287724 | 2023-12-21 12:21:52.522 +0000 UTC |
|
||||
// | 2023-12-21 12:21:27.724919 +0000 UTC | 2023-12-21 12:21:27.724 +0000 UTC | 1703161287724919000 | 2023-12-21 12:21:52.522 +0000 UTC |
|
||||
// | null | null | null | null |
|
||||
// +--------------------------------------+-----------------------------------+---------------------+-----------------------------------+
|
||||
//
|
||||
//
|
||||
// 🌟 This was machine generated. Do not edit. 🌟
|
||||
{
|
||||
"status": 200,
|
||||
"frames": [
|
||||
{
|
||||
"schema": {
|
||||
"meta": {
|
||||
"typeVersion": [
|
||||
0,
|
||||
0
|
||||
],
|
||||
"executedQueryString": "SELECT * FROM tbl"
|
||||
},
|
||||
"fields": [
|
||||
{
|
||||
"name": "reallyt",
|
||||
"type": "time",
|
||||
"typeInfo": {
|
||||
"frame": "time.Time",
|
||||
"nullable": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "time",
|
||||
"type": "time",
|
||||
"typeInfo": {
|
||||
"frame": "time.Time",
|
||||
"nullable": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "n",
|
||||
"type": "number",
|
||||
"typeInfo": {
|
||||
"frame": "int64",
|
||||
"nullable": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "timeend",
|
||||
"type": "time",
|
||||
"typeInfo": {
|
||||
"frame": "time.Time",
|
||||
"nullable": true
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"data": {
|
||||
"values": [
|
||||
[
|
||||
1703161287000,
|
||||
1703161287724,
|
||||
1703161287724,
|
||||
null
|
||||
],
|
||||
[
|
||||
1703161287000,
|
||||
1703161287724,
|
||||
1703161287724,
|
||||
null
|
||||
],
|
||||
[
|
||||
1703161287,
|
||||
1703161287724,
|
||||
1703161287724919000,
|
||||
null
|
||||
],
|
||||
[
|
||||
1703161312000,
|
||||
1703161312522,
|
||||
1703161312522,
|
||||
null
|
||||
]
|
||||
],
|
||||
"nanos": [
|
||||
[
|
||||
0,
|
||||
0,
|
||||
919000,
|
||||
0
|
||||
],
|
||||
null,
|
||||
null,
|
||||
null
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
-- SELECT * FROM tbl
|
||||
-- the time-field and time-end field gets converted to time.Time
|
||||
CREATE TABLE tbl (
|
||||
-- note, in the timestmap below we must say `NULL` otherwise mysql-below-8 inserts current timestamp
|
||||
reallyt timestamp(6) NULL, -- reference real timestamp
|
||||
"time" bigint,
|
||||
n bigint, -- normal number, it should not get converted to a timestamp
|
||||
timeend bigint
|
||||
);
|
||||
|
||||
INSERT INTO tbl (reallyt, "time", n, timeend) VALUES
|
||||
('2023-12-21T12:21:27 UTC', 1703161287, 1703161287, 1703161312),
|
||||
('2023-12-21T12:21:27.724 UTC', 1703161287724, 1703161287724, 1703161312522),
|
||||
('2023-12-21T12:21:27.724919 UTC', 1703161287724919000, 1703161287724919000, 1703161312522186000),
|
||||
(NULL, NULL, NULL, NULL);
|
||||
@@ -0,0 +1,113 @@
|
||||
// 🌟 This was machine generated. Do not edit. 🌟
|
||||
//
|
||||
// Frame[0] {
|
||||
// "typeVersion": [
|
||||
// 0,
|
||||
// 0
|
||||
// ],
|
||||
// "executedQueryString": "SELECT * FROM tbl"
|
||||
// }
|
||||
// Name:
|
||||
// Dimensions: 4 Fields by 4 Rows
|
||||
// +--------------------------------------+-----------------------------------+-----------------------+-----------------------------------+
|
||||
// | Name: reallyt | Name: time | Name: n | Name: timeend |
|
||||
// | Labels: | Labels: | Labels: | Labels: |
|
||||
// | Type: []*time.Time | Type: []*time.Time | Type: []*float64 | Type: []*time.Time |
|
||||
// +--------------------------------------+-----------------------------------+-----------------------+-----------------------------------+
|
||||
// | 2023-12-21 12:21:27 +0000 UTC | 2023-12-21 12:21:27 +0000 UTC | 1.703161287e+09 | 2023-12-21 12:21:52 +0000 UTC |
|
||||
// | 2023-12-21 12:21:27.724 +0000 UTC | 2023-12-21 12:21:27.724 +0000 UTC | 1.703161287724e+12 | 2023-12-21 12:21:52.522 +0000 UTC |
|
||||
// | 2023-12-21 12:21:27.724919 +0000 UTC | 2023-12-21 12:21:27.724 +0000 UTC | 1.703161287724919e+18 | 2023-12-21 12:21:52.522 +0000 UTC |
|
||||
// | null | null | null | null |
|
||||
// +--------------------------------------+-----------------------------------+-----------------------+-----------------------------------+
|
||||
//
|
||||
//
|
||||
// 🌟 This was machine generated. Do not edit. 🌟
|
||||
{
|
||||
"status": 200,
|
||||
"frames": [
|
||||
{
|
||||
"schema": {
|
||||
"meta": {
|
||||
"typeVersion": [
|
||||
0,
|
||||
0
|
||||
],
|
||||
"executedQueryString": "SELECT * FROM tbl"
|
||||
},
|
||||
"fields": [
|
||||
{
|
||||
"name": "reallyt",
|
||||
"type": "time",
|
||||
"typeInfo": {
|
||||
"frame": "time.Time",
|
||||
"nullable": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "time",
|
||||
"type": "time",
|
||||
"typeInfo": {
|
||||
"frame": "time.Time",
|
||||
"nullable": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "n",
|
||||
"type": "number",
|
||||
"typeInfo": {
|
||||
"frame": "float64",
|
||||
"nullable": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "timeend",
|
||||
"type": "time",
|
||||
"typeInfo": {
|
||||
"frame": "time.Time",
|
||||
"nullable": true
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"data": {
|
||||
"values": [
|
||||
[
|
||||
1703161287000,
|
||||
1703161287724,
|
||||
1703161287724,
|
||||
null
|
||||
],
|
||||
[
|
||||
1703161287000,
|
||||
1703161287724,
|
||||
1703161287724,
|
||||
null
|
||||
],
|
||||
[
|
||||
1703161287,
|
||||
1703161287724,
|
||||
1703161287724919000,
|
||||
null
|
||||
],
|
||||
[
|
||||
1703161312000,
|
||||
1703161312522,
|
||||
1703161312522,
|
||||
null
|
||||
]
|
||||
],
|
||||
"nanos": [
|
||||
[
|
||||
0,
|
||||
0,
|
||||
919000,
|
||||
0
|
||||
],
|
||||
null,
|
||||
null,
|
||||
null
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
-- SELECT * FROM tbl
|
||||
-- the time-field and time-end field gets converted to time.Time
|
||||
CREATE TABLE tbl (
|
||||
-- note, in the timestmap below we must say `NULL` otherwise mysql-below-8 inserts current timestamp
|
||||
reallyt timestamp(6) NULL, -- reference real timestamp
|
||||
"time" double precision,
|
||||
n double precision, -- normal number, it should not get converted to a timestamp
|
||||
timeend bigint
|
||||
);
|
||||
|
||||
INSERT INTO tbl (reallyt, "time", n, timeend) VALUES
|
||||
('2023-12-21T12:21:27 UTC', 1703161287, 1703161287, 1703161312),
|
||||
('2023-12-21T12:21:27.724 UTC', 1703161287724, 1703161287724, 1703161312522),
|
||||
('2023-12-21T12:21:27.724919 UTC', 1703161287724919000, 1703161287724919000, 1703161312522186000),
|
||||
(NULL, NULL, NULL, NULL);
|
||||
@@ -0,0 +1,113 @@
|
||||
// 🌟 This was machine generated. Do not edit. 🌟
|
||||
//
|
||||
// Frame[0] {
|
||||
// "typeVersion": [
|
||||
// 0,
|
||||
// 0
|
||||
// ],
|
||||
// "executedQueryString": "SELECT * FROM tbl"
|
||||
// }
|
||||
// Name:
|
||||
// Dimensions: 4 Fields by 4 Rows
|
||||
// +--------------------------------------+-----------------------------------+-----------------------+-----------------------------------+
|
||||
// | Name: reallyt | Name: time | Name: n | Name: timeend |
|
||||
// | Labels: | Labels: | Labels: | Labels: |
|
||||
// | Type: []*time.Time | Type: []*time.Time | Type: []*float64 | Type: []*time.Time |
|
||||
// +--------------------------------------+-----------------------------------+-----------------------+-----------------------------------+
|
||||
// | 2023-12-21 12:22:24 +0000 UTC | 2023-12-21 12:22:24 +0000 UTC | 1.703161344e+09 | 2023-12-21 12:22:52 +0000 UTC |
|
||||
// | 2023-12-21 12:20:33.408 +0000 UTC | 2023-12-21 12:20:33.408 +0000 UTC | 1.703161233408e+12 | 2023-12-21 12:21:52.522 +0000 UTC |
|
||||
// | 2023-12-21 12:20:41.050022 +0000 UTC | 2023-12-21 12:20:41.05 +0000 UTC | 1.703161241050022e+18 | 2023-12-21 12:21:52.522 +0000 UTC |
|
||||
// | null | null | null | null |
|
||||
// +--------------------------------------+-----------------------------------+-----------------------+-----------------------------------+
|
||||
//
|
||||
//
|
||||
// 🌟 This was machine generated. Do not edit. 🌟
|
||||
{
|
||||
"status": 200,
|
||||
"frames": [
|
||||
{
|
||||
"schema": {
|
||||
"meta": {
|
||||
"typeVersion": [
|
||||
0,
|
||||
0
|
||||
],
|
||||
"executedQueryString": "SELECT * FROM tbl"
|
||||
},
|
||||
"fields": [
|
||||
{
|
||||
"name": "reallyt",
|
||||
"type": "time",
|
||||
"typeInfo": {
|
||||
"frame": "time.Time",
|
||||
"nullable": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "time",
|
||||
"type": "time",
|
||||
"typeInfo": {
|
||||
"frame": "time.Time",
|
||||
"nullable": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "n",
|
||||
"type": "number",
|
||||
"typeInfo": {
|
||||
"frame": "float64",
|
||||
"nullable": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "timeend",
|
||||
"type": "time",
|
||||
"typeInfo": {
|
||||
"frame": "time.Time",
|
||||
"nullable": true
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"data": {
|
||||
"values": [
|
||||
[
|
||||
1703161344000,
|
||||
1703161233408,
|
||||
1703161241050,
|
||||
null
|
||||
],
|
||||
[
|
||||
1703161344000,
|
||||
1703161233408,
|
||||
1703161241050,
|
||||
null
|
||||
],
|
||||
[
|
||||
1703161344,
|
||||
1703161233408,
|
||||
1703161241050022000,
|
||||
null
|
||||
],
|
||||
[
|
||||
1703161372000,
|
||||
1703161312522,
|
||||
1703161312522,
|
||||
null
|
||||
]
|
||||
],
|
||||
"nanos": [
|
||||
[
|
||||
0,
|
||||
0,
|
||||
22000,
|
||||
0
|
||||
],
|
||||
null,
|
||||
null,
|
||||
null
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
-- SELECT * FROM tbl
|
||||
-- the time-field and time-end field gets converted to time.Time
|
||||
CREATE TABLE tbl (
|
||||
-- note, in the timestmap below we must say `NULL` otherwise mysql-below-8 inserts current timestamp
|
||||
reallyt timestamp(6) NULL, -- reference real timestamp
|
||||
"time" real,
|
||||
n real, -- normal number, it should not get converted to a timestamp
|
||||
timeend bigint
|
||||
);
|
||||
|
||||
INSERT INTO tbl (reallyt, "time", n, timeend) VALUES
|
||||
('2023-12-21T12:22:24', 1703161344, 1703161344, 1703161372),
|
||||
('2023-12-21T12:20:33.408', 1703161233408, 1703161233408, 1703161312522),
|
||||
('2023-12-21T12:20:41.050022', 1703161241050021888, 1703161241050021888, 1703161312522186000),
|
||||
(NULL, NULL, NULL, NULL);
|
||||
@@ -0,0 +1,92 @@
|
||||
// 🌟 This was machine generated. Do not edit. 🌟
|
||||
//
|
||||
// Frame[0] {
|
||||
// "typeVersion": [
|
||||
// 0,
|
||||
// 0
|
||||
// ],
|
||||
// "executedQueryString": "SELECT * FROM tbl"
|
||||
// }
|
||||
// Name:
|
||||
// Dimensions: 4 Fields by 2 Rows
|
||||
// +-------------------------------+-------------------------------+----------------+-------------------------------+
|
||||
// | Name: reallyt | Name: time | Name: n | Name: timeend |
|
||||
// | Labels: | Labels: | Labels: | Labels: |
|
||||
// | Type: []*time.Time | Type: []*time.Time | Type: []*int64 | Type: []*time.Time |
|
||||
// +-------------------------------+-------------------------------+----------------+-------------------------------+
|
||||
// | 2023-12-21 12:21:27 +0000 UTC | 2023-12-21 12:21:27 +0000 UTC | 1703161287 | 2023-12-21 12:21:52 +0000 UTC |
|
||||
// | null | null | null | null |
|
||||
// +-------------------------------+-------------------------------+----------------+-------------------------------+
|
||||
//
|
||||
//
|
||||
// 🌟 This was machine generated. Do not edit. 🌟
|
||||
{
|
||||
"status": 200,
|
||||
"frames": [
|
||||
{
|
||||
"schema": {
|
||||
"meta": {
|
||||
"typeVersion": [
|
||||
0,
|
||||
0
|
||||
],
|
||||
"executedQueryString": "SELECT * FROM tbl"
|
||||
},
|
||||
"fields": [
|
||||
{
|
||||
"name": "reallyt",
|
||||
"type": "time",
|
||||
"typeInfo": {
|
||||
"frame": "time.Time",
|
||||
"nullable": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "time",
|
||||
"type": "time",
|
||||
"typeInfo": {
|
||||
"frame": "time.Time",
|
||||
"nullable": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "n",
|
||||
"type": "number",
|
||||
"typeInfo": {
|
||||
"frame": "int64",
|
||||
"nullable": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "timeend",
|
||||
"type": "time",
|
||||
"typeInfo": {
|
||||
"frame": "time.Time",
|
||||
"nullable": true
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"data": {
|
||||
"values": [
|
||||
[
|
||||
1703161287000,
|
||||
null
|
||||
],
|
||||
[
|
||||
1703161287000,
|
||||
null
|
||||
],
|
||||
[
|
||||
1703161287,
|
||||
null
|
||||
],
|
||||
[
|
||||
1703161312000,
|
||||
null
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
-- SELECT * FROM tbl
|
||||
-- the time-field and time-end field gets converted to time.Time
|
||||
CREATE TABLE tbl (
|
||||
-- note, in the timestmap below we must say `NULL` otherwise mysql-below-8 inserts current timestamp
|
||||
reallyt timestamp(6) NULL, -- reference real timestamp
|
||||
"time" integer, -- 32bits, seconds-as-number is highest we can go, milliseconds-as-number does not fit
|
||||
n integer, -- normal number, it should not get converted to a timestamp
|
||||
timeend integer
|
||||
);
|
||||
|
||||
INSERT INTO tbl (reallyt, "time", n, timeend) VALUES
|
||||
('2023-12-21T12:21:27 UTC', 1703161287, 1703161287, 1703161312),
|
||||
(NULL, NULL, NULL, NULL);
|
||||
@@ -0,0 +1,236 @@
|
||||
// 🌟 This was machine generated. Do not edit. 🌟
|
||||
//
|
||||
// Frame[0] {
|
||||
// "typeVersion": [
|
||||
// 0,
|
||||
// 0
|
||||
// ],
|
||||
// "executedQueryString": "SELECT * FROM tbl"
|
||||
// }
|
||||
// Name:
|
||||
// Dimensions: 16 Fields by 2 Rows
|
||||
// +-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+
|
||||
// | Name: vc | Name: vcnn | Name: c | Name: cnn | Name: tt | Name: ttnn | Name: t | Name: tnn | Name: mt | Name: mtnn | Name: lt | Name: ltnn | Name: e | Name: enn | Name: s | Name: snn |
|
||||
// | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: |
|
||||
// | Type: []*string | Type: []*string | Type: []*string | Type: []*string | Type: []*string | Type: []*string | Type: []*string | Type: []*string | Type: []*string | Type: []*string | Type: []*string | Type: []*string | Type: []*string | Type: []*string | Type: []*string | Type: []*string |
|
||||
// +-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+
|
||||
// | one | two | three | four | five | six | seven | eight | nine | ten | eleven | twelve | v1 | v2 | a,b | |
|
||||
// | null | xtwo | null | xfour | null | xsix | null | xeight | null | xten | null | xtwelve | null | v1 | null | a,c |
|
||||
// +-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+
|
||||
//
|
||||
//
|
||||
// 🌟 This was machine generated. Do not edit. 🌟
|
||||
{
|
||||
"status": 200,
|
||||
"frames": [
|
||||
{
|
||||
"schema": {
|
||||
"meta": {
|
||||
"typeVersion": [
|
||||
0,
|
||||
0
|
||||
],
|
||||
"executedQueryString": "SELECT * FROM tbl"
|
||||
},
|
||||
"fields": [
|
||||
{
|
||||
"name": "vc",
|
||||
"type": "string",
|
||||
"typeInfo": {
|
||||
"frame": "string",
|
||||
"nullable": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "vcnn",
|
||||
"type": "string",
|
||||
"typeInfo": {
|
||||
"frame": "string",
|
||||
"nullable": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "c",
|
||||
"type": "string",
|
||||
"typeInfo": {
|
||||
"frame": "string",
|
||||
"nullable": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "cnn",
|
||||
"type": "string",
|
||||
"typeInfo": {
|
||||
"frame": "string",
|
||||
"nullable": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "tt",
|
||||
"type": "string",
|
||||
"typeInfo": {
|
||||
"frame": "string",
|
||||
"nullable": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "ttnn",
|
||||
"type": "string",
|
||||
"typeInfo": {
|
||||
"frame": "string",
|
||||
"nullable": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "t",
|
||||
"type": "string",
|
||||
"typeInfo": {
|
||||
"frame": "string",
|
||||
"nullable": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "tnn",
|
||||
"type": "string",
|
||||
"typeInfo": {
|
||||
"frame": "string",
|
||||
"nullable": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "mt",
|
||||
"type": "string",
|
||||
"typeInfo": {
|
||||
"frame": "string",
|
||||
"nullable": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "mtnn",
|
||||
"type": "string",
|
||||
"typeInfo": {
|
||||
"frame": "string",
|
||||
"nullable": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "lt",
|
||||
"type": "string",
|
||||
"typeInfo": {
|
||||
"frame": "string",
|
||||
"nullable": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "ltnn",
|
||||
"type": "string",
|
||||
"typeInfo": {
|
||||
"frame": "string",
|
||||
"nullable": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "e",
|
||||
"type": "string",
|
||||
"typeInfo": {
|
||||
"frame": "string",
|
||||
"nullable": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "enn",
|
||||
"type": "string",
|
||||
"typeInfo": {
|
||||
"frame": "string",
|
||||
"nullable": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "s",
|
||||
"type": "string",
|
||||
"typeInfo": {
|
||||
"frame": "string",
|
||||
"nullable": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "snn",
|
||||
"type": "string",
|
||||
"typeInfo": {
|
||||
"frame": "string",
|
||||
"nullable": true
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"data": {
|
||||
"values": [
|
||||
[
|
||||
"one",
|
||||
null
|
||||
],
|
||||
[
|
||||
"two",
|
||||
"xtwo"
|
||||
],
|
||||
[
|
||||
"three",
|
||||
null
|
||||
],
|
||||
[
|
||||
"four",
|
||||
"xfour"
|
||||
],
|
||||
[
|
||||
"five",
|
||||
null
|
||||
],
|
||||
[
|
||||
"six",
|
||||
"xsix"
|
||||
],
|
||||
[
|
||||
"seven",
|
||||
null
|
||||
],
|
||||
[
|
||||
"eight",
|
||||
"xeight"
|
||||
],
|
||||
[
|
||||
"nine",
|
||||
null
|
||||
],
|
||||
[
|
||||
"ten",
|
||||
"xten"
|
||||
],
|
||||
[
|
||||
"eleven",
|
||||
null
|
||||
],
|
||||
[
|
||||
"twelve",
|
||||
"xtwelve"
|
||||
],
|
||||
[
|
||||
"v1",
|
||||
null
|
||||
],
|
||||
[
|
||||
"v2",
|
||||
"v1"
|
||||
],
|
||||
[
|
||||
"a,b",
|
||||
null
|
||||
],
|
||||
[
|
||||
"",
|
||||
"a,c"
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
-- SELECT * FROM tbl
|
||||
-- test all character-based mysql data types
|
||||
CREATE TABLE tbl (
|
||||
vc varchar(10),
|
||||
vcnn varchar(10) NOT NULL,
|
||||
c char(10),
|
||||
cnn char(10) NOT NULL,
|
||||
tt tinytext,
|
||||
ttnn tinytext NOT NULL,
|
||||
t text,
|
||||
tnn text NOT NULL,
|
||||
mt mediumtext,
|
||||
mtnn mediumtext NOT NULL,
|
||||
lt longtext,
|
||||
ltnn longtext NOT NULL,
|
||||
e enum('v1', 'v2'),
|
||||
enn enum('v1', 'v2') NOT NULL,
|
||||
s set('a', 'b', 'c'),
|
||||
snn set('a', 'b', 'c') NOT NULL
|
||||
);
|
||||
|
||||
INSERT INTO tbl (vc, vcnn, c, cnn, tt, ttnn, t, tnn, mt, mtnn, lt, ltnn, e, enn, s, snn) VALUES
|
||||
('one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'ten', 'eleven', 'twelve', 'v1', 'v2', 'a,b', ''),
|
||||
(NULL, 'xtwo', NULL, 'xfour', NULL, 'xsix', NULL, 'xeight' , NULL, 'xten', NULL, 'xtwelve', NULL, 'v1', NULL, 'a,c');
|
||||
@@ -0,0 +1,266 @@
|
||||
// 🌟 This was machine generated. Do not edit. 🌟
|
||||
//
|
||||
// Frame[0] {
|
||||
// "typeVersion": [
|
||||
// 0,
|
||||
// 0
|
||||
// ],
|
||||
// "executedQueryString": "SELECT * FROM tbl"
|
||||
// }
|
||||
// Name:
|
||||
// Dimensions: 16 Fields by 2 Rows
|
||||
// +-------------------------------+-------------------------------+--------------------------------------+--------------------------------------+-------------------------------+-------------------------------+--------------------------------------+--------------------------------------+-------------------------------+-------------------------------+-----------------+-----------------+-----------------+-----------------+----------------+----------------+
|
||||
// | Name: ts | Name: tsnn | Name: ts6 | Name: ts6nn | Name: dt | Name: dtnn | Name: dt6 | Name: dt6nn | Name: d | Name: dnn | Name: t | Name: tnn | Name: t6 | Name: t6nn | Name: y | Name: ynn |
|
||||
// | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: |
|
||||
// | Type: []*time.Time | Type: []*time.Time | Type: []*time.Time | Type: []*time.Time | Type: []*time.Time | Type: []*time.Time | Type: []*time.Time | Type: []*time.Time | Type: []*time.Time | Type: []*time.Time | Type: []*string | Type: []*string | Type: []*string | Type: []*string | Type: []*int64 | Type: []*int64 |
|
||||
// +-------------------------------+-------------------------------+--------------------------------------+--------------------------------------+-------------------------------+-------------------------------+--------------------------------------+--------------------------------------+-------------------------------+-------------------------------+-----------------+-----------------+-----------------+-----------------+----------------+----------------+
|
||||
// | 2023-11-15 05:06:07 +0000 UTC | 2023-11-15 05:06:08 +0000 UTC | 2021-07-22 13:22:33.654321 +0000 UTC | 2021-07-22 13:22:34.654321 +0000 UTC | 2023-11-15 06:06:07 +0000 UTC | 2023-11-15 06:06:08 +0000 UTC | 2021-07-22 14:22:33.654321 +0000 UTC | 2021-07-22 14:22:34.654321 +0000 UTC | 2023-12-20 00:00:00 +0000 UTC | 2023-12-21 00:00:00 +0000 UTC | 12:34:56 | 12:34:57 | 12:44:56.234567 | 12:44:57.234567 | 2022 | 2023 |
|
||||
// | null | 2023-11-15 05:06:09 +0000 UTC | null | 2021-07-22 13:22:35.654321 +0000 UTC | null | 2023-11-16 05:06:09 +0000 UTC | null | 2021-07-23 13:22:35.654321 +0000 UTC | null | 2023-12-22 00:00:00 +0000 UTC | null | 12:34:58 | null | 12:44:58.234567 | null | 2024 |
|
||||
// +-------------------------------+-------------------------------+--------------------------------------+--------------------------------------+-------------------------------+-------------------------------+--------------------------------------+--------------------------------------+-------------------------------+-------------------------------+-----------------+-----------------+-----------------+-----------------+----------------+----------------+
|
||||
//
|
||||
//
|
||||
// 🌟 This was machine generated. Do not edit. 🌟
|
||||
{
|
||||
"status": 200,
|
||||
"frames": [
|
||||
{
|
||||
"schema": {
|
||||
"meta": {
|
||||
"typeVersion": [
|
||||
0,
|
||||
0
|
||||
],
|
||||
"executedQueryString": "SELECT * FROM tbl"
|
||||
},
|
||||
"fields": [
|
||||
{
|
||||
"name": "ts",
|
||||
"type": "time",
|
||||
"typeInfo": {
|
||||
"frame": "time.Time",
|
||||
"nullable": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "tsnn",
|
||||
"type": "time",
|
||||
"typeInfo": {
|
||||
"frame": "time.Time",
|
||||
"nullable": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "ts6",
|
||||
"type": "time",
|
||||
"typeInfo": {
|
||||
"frame": "time.Time",
|
||||
"nullable": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "ts6nn",
|
||||
"type": "time",
|
||||
"typeInfo": {
|
||||
"frame": "time.Time",
|
||||
"nullable": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "dt",
|
||||
"type": "time",
|
||||
"typeInfo": {
|
||||
"frame": "time.Time",
|
||||
"nullable": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "dtnn",
|
||||
"type": "time",
|
||||
"typeInfo": {
|
||||
"frame": "time.Time",
|
||||
"nullable": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "dt6",
|
||||
"type": "time",
|
||||
"typeInfo": {
|
||||
"frame": "time.Time",
|
||||
"nullable": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "dt6nn",
|
||||
"type": "time",
|
||||
"typeInfo": {
|
||||
"frame": "time.Time",
|
||||
"nullable": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "d",
|
||||
"type": "time",
|
||||
"typeInfo": {
|
||||
"frame": "time.Time",
|
||||
"nullable": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "dnn",
|
||||
"type": "time",
|
||||
"typeInfo": {
|
||||
"frame": "time.Time",
|
||||
"nullable": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "t",
|
||||
"type": "string",
|
||||
"typeInfo": {
|
||||
"frame": "string",
|
||||
"nullable": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "tnn",
|
||||
"type": "string",
|
||||
"typeInfo": {
|
||||
"frame": "string",
|
||||
"nullable": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "t6",
|
||||
"type": "string",
|
||||
"typeInfo": {
|
||||
"frame": "string",
|
||||
"nullable": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "t6nn",
|
||||
"type": "string",
|
||||
"typeInfo": {
|
||||
"frame": "string",
|
||||
"nullable": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "y",
|
||||
"type": "number",
|
||||
"typeInfo": {
|
||||
"frame": "int64",
|
||||
"nullable": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "ynn",
|
||||
"type": "number",
|
||||
"typeInfo": {
|
||||
"frame": "int64",
|
||||
"nullable": true
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"data": {
|
||||
"values": [
|
||||
[
|
||||
1700024767000,
|
||||
null
|
||||
],
|
||||
[
|
||||
1700024768000,
|
||||
1700024769000
|
||||
],
|
||||
[
|
||||
1626960153654,
|
||||
null
|
||||
],
|
||||
[
|
||||
1626960154654,
|
||||
1626960155654
|
||||
],
|
||||
[
|
||||
1700028367000,
|
||||
null
|
||||
],
|
||||
[
|
||||
1700028368000,
|
||||
1700111169000
|
||||
],
|
||||
[
|
||||
1626963753654,
|
||||
null
|
||||
],
|
||||
[
|
||||
1626963754654,
|
||||
1627046555654
|
||||
],
|
||||
[
|
||||
1703030400000,
|
||||
null
|
||||
],
|
||||
[
|
||||
1703116800000,
|
||||
1703203200000
|
||||
],
|
||||
[
|
||||
"12:34:56",
|
||||
null
|
||||
],
|
||||
[
|
||||
"12:34:57",
|
||||
"12:34:58"
|
||||
],
|
||||
[
|
||||
"12:44:56.234567",
|
||||
null
|
||||
],
|
||||
[
|
||||
"12:44:57.234567",
|
||||
"12:44:58.234567"
|
||||
],
|
||||
[
|
||||
2022,
|
||||
null
|
||||
],
|
||||
[
|
||||
2023,
|
||||
2024
|
||||
]
|
||||
],
|
||||
"nanos": [
|
||||
null,
|
||||
null,
|
||||
[
|
||||
321000,
|
||||
0
|
||||
],
|
||||
[
|
||||
321000,
|
||||
321000
|
||||
],
|
||||
null,
|
||||
null,
|
||||
[
|
||||
321000,
|
||||
0
|
||||
],
|
||||
[
|
||||
321000,
|
||||
321000
|
||||
],
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
-- SELECT * FROM tbl
|
||||
-- test all date/time-based postgres data types
|
||||
CREATE TABLE tbl (
|
||||
ts timestamp NULL, -- must say `NULL` for below mysql8, see (explicit_defaults_for_timestamp)
|
||||
tsnn timestamp NOT NULL,
|
||||
ts6 timestamp(6) NULL, -- must say `NULL` for below mysql8, see (explicit_defaults_for_timestamp)
|
||||
ts6nn timestamp(6) NOT NULL,
|
||||
dt datetime,
|
||||
dtnn datetime NOT NULL,
|
||||
dt6 datetime(6),
|
||||
dt6nn datetime(6) NOT NULL,
|
||||
d date,
|
||||
dnn date NOT NULL,
|
||||
t time,
|
||||
tnn time NOT NULL,
|
||||
t6 time(6),
|
||||
t6nn time(6) NOT NULL,
|
||||
y year,
|
||||
ynn year NOT NULL
|
||||
);
|
||||
|
||||
INSERT INTO tbl (ts, tsnn, ts6, ts6nn, dt, dtnn, dt6, dt6nn, d, dnn, t, tnn, t6, t6nn, y, ynn) VALUES (
|
||||
'2023-11-15 05:06:07+00:00',
|
||||
'2023-11-15 05:06:08+00:00',
|
||||
'2021-07-22 13:22:33.654321+00:00',
|
||||
'2021-07-22 13:22:34.654321+00:00',
|
||||
'2023-11-15 06:06:07+00:00',
|
||||
'2023-11-15 06:06:08+00:00',
|
||||
'2021-07-22 14:22:33.654321+00:00',
|
||||
'2021-07-22 14:22:34.654321+00:00',
|
||||
'2023-12-20',
|
||||
'2023-12-21',
|
||||
'12:34:56',
|
||||
'12:34:57',
|
||||
'12:44:56.234567',
|
||||
'12:44:57.234567',
|
||||
'2022',
|
||||
'2023'
|
||||
), (
|
||||
NULL,
|
||||
'2023-11-15 05:06:09+00:00',
|
||||
NULL,
|
||||
'2021-07-22 13:22:35.654321+00:00',
|
||||
NULL,
|
||||
'2023-11-16 05:06:09+00:00',
|
||||
NULL,
|
||||
'2021-07-23 13:22:35.654321+00:00',
|
||||
NULL,
|
||||
'2023-12-22',
|
||||
NULL,
|
||||
'12:34:58',
|
||||
NULL,
|
||||
'12:44:58.234567',
|
||||
NULL,
|
||||
'2024'
|
||||
);
|
||||
@@ -0,0 +1,235 @@
|
||||
// 🌟 This was machine generated. Do not edit. 🌟
|
||||
//
|
||||
// Frame[0] {
|
||||
// "typeVersion": [
|
||||
// 0,
|
||||
// 0
|
||||
// ],
|
||||
// "executedQueryString": "SELECT * FROM tbl"
|
||||
// }
|
||||
// Name:
|
||||
// Dimensions: 16 Fields by 2 Rows
|
||||
// +----------------+----------------+----------------+----------------+----------------+---------------+----------------+----------------+----------------+----------------+------------------+------------------+------------------+------------------+------------------+------------------+
|
||||
// | Name: i8 | Name: i8nn | Name: i16 | Name: i16nn | Name: i24 | Name: i24nn | Name: i32 | Name: i32nn | Name: i64 | Name: i64nn | Name: d | Name: dnn | Name: f32 | Name: f32nn | Name: f64 | Name: f64nn |
|
||||
// | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: |
|
||||
// | Type: []*int64 | Type: []*int64 | Type: []*int64 | Type: []*int64 | Type: []*int64 | Type: []int32 | Type: []*int64 | Type: []*int64 | Type: []*int64 | Type: []*int64 | Type: []*float64 | Type: []*float64 | Type: []*float64 | Type: []*float64 | Type: []*float64 | Type: []*float64 |
|
||||
// +----------------+----------------+----------------+----------------+----------------+---------------+----------------+----------------+----------------+----------------+------------------+------------------+------------------+------------------+------------------+------------------+
|
||||
// | -5 | -4 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 81.75 | 7065.25 | 30.75 | 14.625 | 21.5625 | 14.25 |
|
||||
// | null | -44 | null | 22 | null | 44 | null | 66 | null | 88 | null | 169.75 | null | 77.125 | null | 215.8125 |
|
||||
// +----------------+----------------+----------------+----------------+----------------+---------------+----------------+----------------+----------------+----------------+------------------+------------------+------------------+------------------+------------------+------------------+
|
||||
//
|
||||
//
|
||||
// 🌟 This was machine generated. Do not edit. 🌟
|
||||
{
|
||||
"status": 200,
|
||||
"frames": [
|
||||
{
|
||||
"schema": {
|
||||
"meta": {
|
||||
"typeVersion": [
|
||||
0,
|
||||
0
|
||||
],
|
||||
"executedQueryString": "SELECT * FROM tbl"
|
||||
},
|
||||
"fields": [
|
||||
{
|
||||
"name": "i8",
|
||||
"type": "number",
|
||||
"typeInfo": {
|
||||
"frame": "int64",
|
||||
"nullable": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "i8nn",
|
||||
"type": "number",
|
||||
"typeInfo": {
|
||||
"frame": "int64",
|
||||
"nullable": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "i16",
|
||||
"type": "number",
|
||||
"typeInfo": {
|
||||
"frame": "int64",
|
||||
"nullable": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "i16nn",
|
||||
"type": "number",
|
||||
"typeInfo": {
|
||||
"frame": "int64",
|
||||
"nullable": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "i24",
|
||||
"type": "number",
|
||||
"typeInfo": {
|
||||
"frame": "int64",
|
||||
"nullable": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "i24nn",
|
||||
"type": "number",
|
||||
"typeInfo": {
|
||||
"frame": "int32"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "i32",
|
||||
"type": "number",
|
||||
"typeInfo": {
|
||||
"frame": "int64",
|
||||
"nullable": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "i32nn",
|
||||
"type": "number",
|
||||
"typeInfo": {
|
||||
"frame": "int64",
|
||||
"nullable": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "i64",
|
||||
"type": "number",
|
||||
"typeInfo": {
|
||||
"frame": "int64",
|
||||
"nullable": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "i64nn",
|
||||
"type": "number",
|
||||
"typeInfo": {
|
||||
"frame": "int64",
|
||||
"nullable": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "d",
|
||||
"type": "number",
|
||||
"typeInfo": {
|
||||
"frame": "float64",
|
||||
"nullable": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "dnn",
|
||||
"type": "number",
|
||||
"typeInfo": {
|
||||
"frame": "float64",
|
||||
"nullable": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "f32",
|
||||
"type": "number",
|
||||
"typeInfo": {
|
||||
"frame": "float64",
|
||||
"nullable": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "f32nn",
|
||||
"type": "number",
|
||||
"typeInfo": {
|
||||
"frame": "float64",
|
||||
"nullable": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "f64",
|
||||
"type": "number",
|
||||
"typeInfo": {
|
||||
"frame": "float64",
|
||||
"nullable": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "f64nn",
|
||||
"type": "number",
|
||||
"typeInfo": {
|
||||
"frame": "float64",
|
||||
"nullable": true
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"data": {
|
||||
"values": [
|
||||
[
|
||||
-5,
|
||||
null
|
||||
],
|
||||
[
|
||||
-4,
|
||||
-44
|
||||
],
|
||||
[
|
||||
1,
|
||||
null
|
||||
],
|
||||
[
|
||||
2,
|
||||
22
|
||||
],
|
||||
[
|
||||
3,
|
||||
null
|
||||
],
|
||||
[
|
||||
4,
|
||||
44
|
||||
],
|
||||
[
|
||||
5,
|
||||
null
|
||||
],
|
||||
[
|
||||
6,
|
||||
66
|
||||
],
|
||||
[
|
||||
7,
|
||||
null
|
||||
],
|
||||
[
|
||||
8,
|
||||
88
|
||||
],
|
||||
[
|
||||
81.75,
|
||||
null
|
||||
],
|
||||
[
|
||||
7065.25,
|
||||
169.75
|
||||
],
|
||||
[
|
||||
30.75,
|
||||
null
|
||||
],
|
||||
[
|
||||
14.625,
|
||||
77.125
|
||||
],
|
||||
[
|
||||
21.5625,
|
||||
null
|
||||
],
|
||||
[
|
||||
14.25,
|
||||
215.8125
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
-- SELECT * FROM tbl
|
||||
-- test all numeric mysql data types
|
||||
CREATE TABLE tbl (
|
||||
i8 tinyint,
|
||||
i8nn tinyint NOT NULL,
|
||||
i16 smallint,
|
||||
i16nn smallint NOT NULL,
|
||||
i24 mediumint,
|
||||
i24nn mediumint NOT NULL,
|
||||
i32 integer,
|
||||
i32nn integer NOT NULL,
|
||||
i64 bigint,
|
||||
i64nn bigint NOT NULL,
|
||||
d decimal(7, 2),
|
||||
dnn decimal(7,2) NOT NULL,
|
||||
f32 float,
|
||||
f32nn float NOT NULL,
|
||||
f64 double precision,
|
||||
f64nn double precision NOT NULL
|
||||
);
|
||||
|
||||
INSERT INTO tbl (i8, i8nn, i16, i16nn, i24, i24nn, i32, i32nn, i64, i64nn, d, dnn, f32, f32nn, f64, f64nn) VALUES
|
||||
(-5, -4, 1, 2, 3, 4, 5, 6, 7, 8, 81.75, 7065.25, 30.75, 14.625, 21.5625, 14.25),
|
||||
(NULL, -44, NULL, 22, NULL, 44, NULL, 66, NULL, 88, NULL, 169.75, NULL, 77.125, NULL, 215.8125);
|
||||
Binary file not shown.
+40
@@ -0,0 +1,40 @@
|
||||
-- SELECT * FROM tbl
|
||||
-- test the less used mysql data types
|
||||
CREATE TABLE tbl (
|
||||
tb tinyblob,
|
||||
tbnn tinyblob NOT NULL,
|
||||
b blob,
|
||||
bnn blob NOT NULL,
|
||||
mb mediumblob,
|
||||
mbnn mediumblob NOT NULL,
|
||||
lb longblob,
|
||||
lbnn longblob NOT NULL,
|
||||
bt bit(1),
|
||||
btnn bit(1) NOT NULL
|
||||
);
|
||||
|
||||
INSERT INTO tbl (tb, tbnn, b, bnn, mb, mbnn, lb, lbnn, bt, btnn) VALUES
|
||||
(
|
||||
UNHEX('4141'),
|
||||
UNHEX('4142'),
|
||||
UNHEX('4143'),
|
||||
UNHEX('4144'),
|
||||
UNHEX('4145'),
|
||||
UNHEX('4146'),
|
||||
UNHEX('4147'),
|
||||
UNHEX('4148'),
|
||||
b'0',
|
||||
b'1'
|
||||
),
|
||||
(
|
||||
NULL,
|
||||
UNHEX('4242'),
|
||||
NULL,
|
||||
UNHEX('4244'),
|
||||
NULL,
|
||||
UNHEX('4246'),
|
||||
NULL,
|
||||
UNHEX('4248'),
|
||||
NULL,
|
||||
b'0'
|
||||
);
|
||||
Reference in New Issue
Block a user