From 91deebd8cc3723af2574544dcc6a42c317dd9bb0 Mon Sep 17 00:00:00 2001 From: arthmis Date: Fri, 6 Dec 2024 11:27:24 -0500 Subject: [PATCH 1/3] Documentation: Change uses of varbinary to varchar in example tables Signed-off-by: arthmis --- content/en/docs/22.0/get-started/local-mac.md | 8 ++++---- content/en/docs/22.0/get-started/operator.md | 8 ++++---- .../docs/22.0/reference/features/global-routing.md | 14 +++++++------- .../vtctldclient_Materialize_create.md | 4 ++-- .../22.0/reference/vreplication/internal/keys.md | 2 +- .../22.0/reference/vreplication/materialize.md | 4 ++-- .../configuration-advanced/createlookupvindex.md | 4 ++-- .../configuration-advanced/region-sharding.md | 6 +++--- .../docs/22.0/user-guides/migration/materialize.md | 4 ++-- .../schema-changes/audit-and-control.md | 6 +++--- 10 files changed, 30 insertions(+), 30 deletions(-) diff --git a/content/en/docs/22.0/get-started/local-mac.md b/content/en/docs/22.0/get-started/local-mac.md index e2e84fb72..31705a7fb 100644 --- a/content/en/docs/22.0/get-started/local-mac.md +++ b/content/en/docs/22.0/get-started/local-mac.md @@ -266,20 +266,20 @@ In this example, we deployed a single unsharded keyspace named `commerce`. Unsha ```sql create table product ( - sku varbinary(128), - description varbinary(128), + sku varchar(128), + description varchar(128), price bigint, primary key(sku) ); create table customer ( customer_id bigint not null auto_increment, - email varbinary(128), + email varchar(128), primary key(customer_id) ); create table corder ( order_id bigint not null auto_increment, customer_id bigint, - sku varbinary(128), + sku varchar(128), price bigint, primary key(order_id) ); diff --git a/content/en/docs/22.0/get-started/operator.md b/content/en/docs/22.0/get-started/operator.md index cda9907b7..a473ea904 100644 --- a/content/en/docs/22.0/get-started/operator.md +++ b/content/en/docs/22.0/get-started/operator.md @@ -136,20 +136,20 @@ In this example, we deployed a single unsharded keyspace named `commerce`. Unsha ``` sql create table product( - sku varbinary(128), - description varbinary(128), + sku varchar(128), + description varchar(128), price bigint, primary key(sku) ); create table customer( customer_id bigint not null auto_increment, - email varbinary(128), + email varchar(128), primary key(customer_id) ); create table corder( order_id bigint not null auto_increment, customer_id bigint, - sku varbinary(128), + sku varchar(128), price bigint, primary key(order_id) ); diff --git a/content/en/docs/22.0/reference/features/global-routing.md b/content/en/docs/22.0/reference/features/global-routing.md index c3813db8e..44572c233 100644 --- a/content/en/docs/22.0/reference/features/global-routing.md +++ b/content/en/docs/22.0/reference/features/global-routing.md @@ -66,7 +66,7 @@ mysql> show columns from corder; +-------------+----------------+------+-----+---------+-------+ | order_id | bigint | NO | PRI | NULL | | | customer_id | bigint | YES | | NULL | | -| sku | varbinary(128) | YES | | NULL | | +| sku | varchar(128) | YES | | NULL | | | price | bigint | YES | | NULL | | +-------------+----------------+------+-----+---------+-------+ 4 rows in set (0.01 sec) @@ -75,8 +75,8 @@ mysql> show columns from product; +-------------+----------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +-------------+----------------+------+-----+---------+-------+ -| sku | varbinary(128) | NO | PRI | NULL | | -| description | varbinary(128) | YES | | NULL | | +| sku | varchar(128) | NO | PRI | NULL | | +| description | varchar(128) | YES | | NULL | | | price | bigint | YES | | NULL | | +-------------+----------------+------+-----+---------+-------+ 3 rows in set (0.00 sec) @@ -106,7 +106,7 @@ mysql> show columns from customer; | Field | Type | Null | Key | Default | Extra | +-------------+----------------+------+-----+---------+-------+ | customer_id | bigint | NO | PRI | NULL | | -| email | varbinary(128) | YES | | NULL | | +| email | varchar(128) | YES | | NULL | | +-------------+----------------+------+-----+---------+-------+ 2 rows in set (0.01 sec) @@ -116,7 +116,7 @@ mysql> show columns from corder; +-------------+----------------+------+-----+---------+-------+ | order_id | bigint | NO | PRI | NULL | | | customer_id | bigint | YES | | NULL | | -| sku | varbinary(128) | YES | | NULL | | +| sku | varchar(128) | YES | | NULL | | | price | bigint | YES | | NULL | | +-------------+----------------+------+-----+---------+-------+ 4 rows in set (0.00 sec) @@ -145,8 +145,8 @@ mysql> show columns from commerce.product; +-------------+----------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +-------------+----------------+------+-----+---------+-------+ -| sku | varbinary(128) | NO | PRI | NULL | | -| description | varbinary(128) | YES | | NULL | | +| sku | varchar(128) | NO | PRI | NULL | | +| description | varchar(128) | YES | | NULL | | | price | bigint | YES | | NULL | | +-------------+----------------+------+-----+---------+-------+ 3 rows in set (0.00 sec) diff --git a/content/en/docs/22.0/reference/programs/vtctldclient/vtctldclient_Materialize/vtctldclient_Materialize_create.md b/content/en/docs/22.0/reference/programs/vtctldclient/vtctldclient_Materialize/vtctldclient_Materialize_create.md index f8bfcfce9..b751b7c6a 100644 --- a/content/en/docs/22.0/reference/programs/vtctldclient/vtctldclient_Materialize/vtctldclient_Materialize_create.md +++ b/content/en/docs/22.0/reference/programs/vtctldclient/vtctldclient_Materialize/vtctldclient_Materialize_create.md @@ -32,7 +32,7 @@ should be copied as-is from the source keyspace. Here's an example value for tab { "target_table": "sales_by_sku", "source_expression": "select sku, count(*) as orders, sum(price) as revenue from corder group by sku", - "create_ddl": "create table sales_by_sku (sku varbinary(128) not null primary key, orders bigint, revenue bigint)" + "create_ddl": "create table sales_by_sku (sku varchar(128) not null primary key, orders bigint, revenue bigint)" } ] @@ -44,7 +44,7 @@ vtctldclient Materialize create ### Examples ``` -vtctldclient --server localhost:15999 materialize --workflow product_sales --target-keyspace commerce create --source-keyspace commerce --table-settings '[{"target_table": "sales_by_sku", "create_ddl": "create table sales_by_sku (sku varbinary(128) not null primary key, orders bigint, revenue bigint)", "source_expression": "select sku, count(*) as orders, sum(price) as revenue from corder group by sku"}]' --cells zone1 --cells zone2 --tablet-types replica +vtctldclient --server localhost:15999 materialize --workflow product_sales --target-keyspace commerce create --source-keyspace commerce --table-settings '[{"target_table": "sales_by_sku", "create_ddl": "create table sales_by_sku (sku varchar(128) not null primary key, orders bigint, revenue bigint)", "source_expression": "select sku, count(*) as orders, sum(price) as revenue from corder group by sku"}]' --cells zone1 --cells zone2 --tablet-types replica ``` ### Options diff --git a/content/en/docs/22.0/reference/vreplication/internal/keys.md b/content/en/docs/22.0/reference/vreplication/internal/keys.md index 6cb62f6f1..04a49501f 100644 --- a/content/en/docs/22.0/reference/vreplication/internal/keys.md +++ b/content/en/docs/22.0/reference/vreplication/internal/keys.md @@ -303,7 +303,7 @@ Let's begin again as a trivial example, both tables have same `PRIMARY KEY`s: CREATE TABLE `corder` ( `order_id` bigint NOT NULL AUTO_INCREMENT, `customer_id` bigint DEFAULT NULL, - `sku` varbinary(128) DEFAULT NULL, + `sku` varchar(128) DEFAULT NULL, `price` bigint DEFAULT NULL, PRIMARY KEY (`order_id`) ) diff --git a/content/en/docs/22.0/reference/vreplication/materialize.md b/content/en/docs/22.0/reference/vreplication/materialize.md index fb144d2d1..4735ce815 100644 --- a/content/en/docs/22.0/reference/vreplication/materialize.md +++ b/content/en/docs/22.0/reference/vreplication/materialize.md @@ -38,7 +38,7 @@ Please see the [`Materialize` command reference](../../programs/vtctldclient/vtc ### Example ```shell -vtctldclient --server localhost:15999 Materialize --workflow product_sales --target-keyspace commerce create --source-keyspace commerce --table-settings '[{"target_table": "sales_by_sku", "create_ddl": "create table sales_by_sku (sku varbinary(128) not null primary key, orders bigint, revenue bigint)", "source_expression": "select sku, count(*) as orders, sum(price) as revenue from corder group by sku"}]' --cells zone1 --cells zone2 --tablet-types replica +vtctldclient --server localhost:15999 Materialize --workflow product_sales --target-keyspace commerce create --source-keyspace commerce --table-settings '[{"target_table": "sales_by_sku", "create_ddl": "create table sales_by_sku (sku varchar(128) not null primary key, orders bigint, revenue bigint)", "source_expression": "select sku, count(*) as orders, sum(price) as revenue from corder group by sku"}]' --cells zone1 --cells zone2 --tablet-types replica ``` ### Parameters @@ -107,7 +107,7 @@ This is a JSON array where each value must contain two key/value pairs. The firs { "target_table": "sales_by_sku", "source_expression": "select sku, count(*) as orders, sum(price) as revenue from corder group by sku", - "create_ddl": "create table sales_by_sku (sku varbinary(128) not null primary key, orders bigint, revenue bigint)" + "create_ddl": "create table sales_by_sku (sku varchar(128) not null primary key, orders bigint, revenue bigint)" } ] ``` diff --git a/content/en/docs/22.0/user-guides/configuration-advanced/createlookupvindex.md b/content/en/docs/22.0/user-guides/configuration-advanced/createlookupvindex.md index 75e54e3b7..462ffeb24 100644 --- a/content/en/docs/22.0/user-guides/configuration-advanced/createlookupvindex.md +++ b/content/en/docs/22.0/user-guides/configuration-advanced/createlookupvindex.md @@ -53,7 +53,7 @@ mysql> desc corder; +-------------+----------------+------+-----+---------+-------+ | order_id | bigint | NO | PRI | NULL | | | customer_id | bigint | YES | | NULL | | -| sku | varbinary(128) | YES | | NULL | | +| sku | varchar(128) | YES | | NULL | | | price | bigint | YES | | NULL | | +-------------+----------------+------+-----+---------+-------+ 4 rows in set (0.01 sec) @@ -480,7 +480,7 @@ mysql> desc corder_lookup; +-------------+----------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +-------------+----------------+------+-----+---------+-------+ -| sku | varbinary(128) | NO | PRI | NULL | | +| sku | varchar(128) | NO | PRI | NULL | | | keyspace_id | varbinary(128) | YES | | NULL | | +-------------+----------------+------+-----+---------+-------+ 2 rows in set (0.01 sec) diff --git a/content/en/docs/22.0/user-guides/configuration-advanced/region-sharding.md b/content/en/docs/22.0/user-guides/configuration-advanced/region-sharding.md index b97a7f895..ec47d4c01 100644 --- a/content/en/docs/22.0/user-guides/configuration-advanced/region-sharding.md +++ b/content/en/docs/22.0/user-guides/configuration-advanced/region-sharding.md @@ -65,9 +65,9 @@ mysql> show create table customer\G Table: customer Create Table: CREATE TABLE `customer` ( `id` int NOT NULL, - `fullname` varbinary(256) DEFAULT NULL, - `nationalid` varbinary(256) DEFAULT NULL, - `country` varbinary(256) DEFAULT NULL, + `fullname` varchar(256) DEFAULT NULL, + `nationalid` varchar(256) DEFAULT NULL, + `country` varchar(256) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci 1 row in set (0.00 sec) diff --git a/content/en/docs/22.0/user-guides/migration/materialize.md b/content/en/docs/22.0/user-guides/migration/materialize.md index 88fda7149..6e3bbbfa9 100644 --- a/content/en/docs/22.0/user-guides/migration/materialize.md +++ b/content/en/docs/22.0/user-guides/migration/materialize.md @@ -91,14 +91,14 @@ $ cat < show create table corder\G Create Table: CREATE TABLE `corder` ( `order_id` bigint(20) NOT NULL AUTO_INCREMENT, `customer_id` bigint(20) DEFAULT NULL, - `sku` varbinary(128) DEFAULT NULL, + `sku` varchar(128) DEFAULT NULL, `price` bigint(20) DEFAULT NULL, `ts` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`order_id`) @@ -728,7 +728,7 @@ mysql> show create table corder\G Create Table: CREATE TABLE `corder` ( `order_id` bigint(20) NOT NULL AUTO_INCREMENT, `customer_id` bigint(20) DEFAULT NULL, - `sku` varbinary(128) DEFAULT NULL, + `sku` varchar(128) DEFAULT NULL, `price` bigint(20) DEFAULT NULL, PRIMARY KEY (`order_id`), KEY `customer_idx` (`customer_id`) @@ -747,7 +747,7 @@ mysql> show create table corder\G Create Table: CREATE TABLE `corder` ( `order_id` bigint(20) NOT NULL AUTO_INCREMENT, `customer_id` bigint(20) DEFAULT NULL, - `sku` varbinary(128) DEFAULT NULL, + `sku` varchar(128) DEFAULT NULL, `price` bigint(20) DEFAULT NULL, `ts` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`order_id`) From fe98667d7f8ccf13324d0f262057f85b0c91d2b8 Mon Sep 17 00:00:00 2001 From: arthmis Date: Fri, 6 Dec 2024 12:03:56 -0500 Subject: [PATCH 2/3] Documentation: update local example doc with varbinary -> varchar change Signed-off-by: arthmis --- content/en/docs/22.0/get-started/local.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/content/en/docs/22.0/get-started/local.md b/content/en/docs/22.0/get-started/local.md index 0653e8688..320922417 100644 --- a/content/en/docs/22.0/get-started/local.md +++ b/content/en/docs/22.0/get-started/local.md @@ -307,20 +307,20 @@ In this example, we deployed a single unsharded keyspace named `commerce`. Unsha ```sql create table product ( - sku varbinary(128), - description varbinary(128), + sku varchar(128), + description varchar(128), price bigint, primary key(sku) ); create table customer ( customer_id bigint not null auto_increment, - email varbinary(128), + email varchar(128), primary key(customer_id) ); create table corder ( order_id bigint not null auto_increment, customer_id bigint, - sku varbinary(128), + sku varchar(128), price bigint, primary key(order_id) ); From 35ac8462e42253c1eeeb2f79b832be92b554267b Mon Sep 17 00:00:00 2001 From: arthmis Date: Fri, 6 Dec 2024 12:42:39 -0500 Subject: [PATCH 3/3] update varbinary to varchar in vstream-stream-migration.md Signed-off-by: arthmis --- .../vreplication/internal/vstream-stream-migration.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/en/docs/22.0/reference/vreplication/internal/vstream-stream-migration.md b/content/en/docs/22.0/reference/vreplication/internal/vstream-stream-migration.md index f22aea00f..5f175d6fa 100644 --- a/content/en/docs/22.0/reference/vreplication/internal/vstream-stream-migration.md +++ b/content/en/docs/22.0/reference/vreplication/internal/vstream-stream-migration.md @@ -40,7 +40,7 @@ separate terminal to stream events from the `customer` table in the `customer` k Initial events will be streamed: ```proto -[type:BEGIN type:FIELD field_event: fields: > ] +[type:BEGIN type:FIELD field_event: fields: > ] [type:VGTID vgtid: > ] [type:ROW row_event: > > type:ROW row_event: > > type:ROW row_event: > > type:ROW row_event: > > type:ROW row_event: > > type:VGTID vgtid: > > > > type:COMMIT ] [type:BEGIN type:VGTID vgtid: > type:COMMIT ] @@ -78,5 +78,5 @@ $ mysql -u root --host=127.0.0.1 -P 15306 -e "insert into customer(customer_id, ``` ```proto -[type:BEGIN timestamp:1616749631 current_time:1616749631516372189 type:FIELD timestamp:1616749631 field_event: fields: > current_time:1616749631517765487 type:ROW timestamp:1616749631 row_event: > row_changes: > > current_time:1616749631517779353 type:VGTID vgtid: shard_gtids: > type:COMMIT timestamp:1616749631 current_time:1616749631517789376 ] +[type:BEGIN timestamp:1616749631 current_time:1616749631516372189 type:FIELD timestamp:1616749631 field_event: fields: > current_time:1616749631517765487 type:ROW timestamp:1616749631 row_event: > row_changes: > > current_time:1616749631517779353 type:VGTID vgtid: shard_gtids: > type:COMMIT timestamp:1616749631 current_time:1616749631517789376 ] ```