From 80e07f055092238ad4353485c34793159b6a3789 Mon Sep 17 00:00:00 2001 From: yangj1211 Date: Wed, 11 Dec 2024 10:27:07 +0800 Subject: [PATCH] add doc of 2.0.1 --- .../How-to-Contribute/preparation.md | 2 +- .../Deploy/deploy-MatrixOne-cluster.md | 2 +- .../deploy-MatrixOne-cluster-with-k8.md | 43 +++ .../deploy-MatrixOne-cluster-without-k8.md | 43 +++ .../Deploy/deploy-matrixone-single-with-s3.md | 2 +- .../Deploy/update-MatrixOne-cluster.md | 2 +- .../connect-mo/configure-mo-ssl-connection.md | 2 +- .../connect-mo/database-client-tools.md | 2 +- .../connect-mo/python-connect-to-matrixone.md | 2 +- .../export-data/select-into-outfile.md | 2 +- .../Develop/import-data/bulk-load/load-csv.md | 4 +- .../import-data/bulk-load/using-source.md | 2 +- docs/MatrixOne/FAQs/product-faqs.md | 2 +- .../install-on-linux-method1.md | 8 +- .../install-on-linux-method2.md | 30 +- .../install-on-linux-method3.md | 16 +- .../install-on-macos-method1.md | 6 +- .../install-on-macos-method2.md | 28 +- .../install-on-macos-method3.md | 18 +- .../Maintain/mount-data-by-docker.md | 6 +- docs/MatrixOne/Overview/whats-new.md | 4 +- .../Reference/Data-Types/datalink-type.md | 3 + .../Mathematical/crc32.md | 45 +++ .../Table/generate_series.md | 75 +++++ .../matrixone-function-list.md | 2 + .../Data-Query-Language/apply/cross-apply.md | 32 ++ .../Data-Query-Language/apply/outer-apply.md | 33 ++ .../Other/SHOW-Statements/show-account.md | 48 +-- .../Reference/SQL-Reference/SQL-Type.md | 5 + .../illegal_login_restrictions.md | 263 ++++++++++++++++ .../system-variables/password_complex.md | 296 ++++++++++++++++++ .../Variable/system-variables/whitelist.md | 83 +++++ .../Reference/mo-tools/mo_ctl_standalone.md | 14 +- .../Release-Notes/release-timeline.md | 1 + docs/MatrixOne/Release-Notes/v24.2.0.1.md | 49 +++ docs/MatrixOne/Security/TLS-introduction.md | 4 +- .../Tutorial/django-python-crud-demo.md | 2 +- docs/MatrixOne/Tutorial/htap-demo.md | 232 ++++++++++++++ docs/MatrixOne/Tutorial/rag-demo.md | 4 +- mkdocs.yml | 28 +- 40 files changed, 1330 insertions(+), 115 deletions(-) create mode 100644 docs/MatrixOne/Reference/Functions-and-Operators/Mathematical/crc32.md create mode 100644 docs/MatrixOne/Reference/Functions-and-Operators/Table/generate_series.md create mode 100644 docs/MatrixOne/Reference/SQL-Reference/Data-Query-Language/apply/cross-apply.md create mode 100644 docs/MatrixOne/Reference/SQL-Reference/Data-Query-Language/apply/outer-apply.md create mode 100644 docs/MatrixOne/Reference/Variable/system-variables/illegal_login_restrictions.md create mode 100644 docs/MatrixOne/Reference/Variable/system-variables/password_complex.md create mode 100644 docs/MatrixOne/Reference/Variable/system-variables/whitelist.md create mode 100644 docs/MatrixOne/Release-Notes/v24.2.0.1.md create mode 100644 docs/MatrixOne/Tutorial/htap-demo.md diff --git a/docs/MatrixOne/Contribution-Guide/How-to-Contribute/preparation.md b/docs/MatrixOne/Contribution-Guide/How-to-Contribute/preparation.md index 508a53c7c..825f88ddf 100644 --- a/docs/MatrixOne/Contribution-Guide/How-to-Contribute/preparation.md +++ b/docs/MatrixOne/Contribution-Guide/How-to-Contribute/preparation.md @@ -16,7 +16,7 @@ These introductions will help you go through you the key concepts and user detai ### Roadmap -MatrixOne v24.2.0.0 has been released, you can see [Release Notes](../../Release-Notes/v24.2.0.0.md) know more information. +MatrixOne v24.2.0.1 has been released, you can see [Release Notes](../../Release-Notes/v24.2.0.1.md) know more information. For the long-term project roadmap, please refer to [MatrixOne roadmap](https://github.com/matrixorigin/matrixone/issues/613) for a more general overview. diff --git a/docs/MatrixOne/Deploy/deploy-MatrixOne-cluster.md b/docs/MatrixOne/Deploy/deploy-MatrixOne-cluster.md index fcbf54d84..7d010bc03 100644 --- a/docs/MatrixOne/Deploy/deploy-MatrixOne-cluster.md +++ b/docs/MatrixOne/Deploy/deploy-MatrixOne-cluster.md @@ -648,7 +648,7 @@ mysql -h $(kubectl get svc/mo-tp-cn -n mo-hn -o jsonpath='{.spec.clusterIP}') -P mysql: [Warning] Using a password on the command line interface can be insecure. Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 163 -Server version: 8.0.30-MatrixOne-v2.0.0 MatrixOne +Server version: 8.0.30-MatrixOne-v2.0.1 MatrixOne Copyright (c) 2000, 2023, Oracle and/or its affiliates. diff --git a/docs/MatrixOne/Deploy/deploy-Matrixone-cluster/deploy-MatrixOne-cluster-with-k8.md b/docs/MatrixOne/Deploy/deploy-Matrixone-cluster/deploy-MatrixOne-cluster-with-k8.md index ff923951c..6be3ba48b 100644 --- a/docs/MatrixOne/Deploy/deploy-Matrixone-cluster/deploy-MatrixOne-cluster-with-k8.md +++ b/docs/MatrixOne/Deploy/deploy-Matrixone-cluster/deploy-MatrixOne-cluster-with-k8.md @@ -479,6 +479,49 @@ This section describes two ways to deploy MatrixOne: YAML and Chart. helm install -n ${NS} ${RELEASE_NAME} matrixone-operator/matrixone --version ${VERSION} -f values.yaml ``` +### Dynamic expansion + +The Operator supports dynamic expansion of the cacheVolume configuration of TN and CN, but does not support the reduction operation. There is no need to restart the CN and TN pods before and after the expansion process. The specific steps are as follows: + +1. Make sure the StorageClass supports the volume extension feature + + ```bash + #View storageclass name + >kubectl get pvc -n ${MO_NS} + + #Check whether StorageClass supports volume extension function + >kubectl get storageclass ${SC_NAME} -oyaml | grep allowVolumeExpansion #SC_NAME is the sc type of pvc used by the mo cluster + allowVolumeExpansion: true #Only when true can subsequent steps be performed + ``` + +2. Enter cluster configuration editing mode + + ```bash + kubectl edit mo -n ${MO_NS} ${MO_NAME} # Among them, MO_NS is the namespace where the MO cluster is deployed, and MO_NAME is the name of the MO cluster; for example,MO_NS=matrixone; MO_NAME=mo_cluster + ``` + +3. Modify the cacheVolume size of tn and cn as needed + + ```bash + - cacheVolume: + size: 900Gi + ``` + + - If it is a CN group, modify spec.cnGroups[0].cacheVolume (or spec.cnGroups[1].cacheVolume, where n in [n] is the array subscript of the CN Group); + - If it is CN, modify spec.tp.cacheVolume; + - If TN, modifies spec.tn.cacheVolume (or spec.dn.cacheVolume). + + Then save and exit: press `esq` keys, and `:wq` + +4. View expansion results + + ```bash + #The value of the `capacity` field is the value after expansion. + >kubectl get pvc -n ${MO_NS} + + >kubectl get pv | grep ${NS} + ``` + ### Checking cluster status Observe cluster status until Ready diff --git a/docs/MatrixOne/Deploy/deploy-Matrixone-cluster/deploy-MatrixOne-cluster-without-k8.md b/docs/MatrixOne/Deploy/deploy-Matrixone-cluster/deploy-MatrixOne-cluster-without-k8.md index 6ea8b0686..4ac7475f4 100644 --- a/docs/MatrixOne/Deploy/deploy-Matrixone-cluster/deploy-MatrixOne-cluster-without-k8.md +++ b/docs/MatrixOne/Deploy/deploy-Matrixone-cluster/deploy-MatrixOne-cluster-without-k8.md @@ -679,6 +679,49 @@ To learn more about Matrixone Operator, check out [Operator Administration](../. mo-tp-cn-0 1/1 Running 0 50s ``` +### Dynamic expansion + +The Operator supports dynamic expansion of the cacheVolume configuration of TN and CN, but does not support the reduction operation. There is no need to restart the CN and TN pods before and after the expansion process. The specific steps are as follows: + +1. Make sure the StorageClass supports the volume extension feature + + ```bash + #View storageclass name + >kubectl get pvc -n ${MO_NS} + + #Check whether StorageClass supports volume extension function + >kubectl get storageclass ${SC_NAME} -oyaml | grep allowVolumeExpansion #SC_NAME is the sc type of pvc used by the mo cluster + allowVolumeExpansion: true #Only when true can subsequent steps be performed + ``` + +2. Enter cluster configuration editing mode + + ```bash + kubectl edit mo -n ${MO_NS} ${MO_NAME} # Among them, MO_NS is the namespace where the MO cluster is deployed, and MO_NAME is the name of the MO cluster; for example,MO_NS=matrixone; MO_NAME=mo_cluster + ``` + +3. Modify the cacheVolume size of tn and cn as needed + + ```bash + - cacheVolume: + size: 900Gi + ``` + + - If it is a CN group, modify spec.cnGroups[0].cacheVolume (or spec.cnGroups[1].cacheVolume, where n in [n] is the array subscript of the CN Group); + - If it is CN, modify spec.tp.cacheVolume; + - If TN, modifies spec.tn.cacheVolume (or spec.dn.cacheVolume). + + Then save and exit: press `esq` keys, and `:wq` + +4. View expansion results + + ```bash + #The value of the `capacity` field is the value after expansion. + >kubectl get pvc -n ${MO_NS} + + >kubectl get pv | grep ${NS} + ``` + ## Connecting a MatrixOne Cluster In order to connect to a MatrixOne cluster, you need to map the port of the corresponding service to the MatrixOne node. Here is a guide for connecting to a MatrixOne cluster using `kubectl port-forward`: diff --git a/docs/MatrixOne/Deploy/deploy-matrixone-single-with-s3.md b/docs/MatrixOne/Deploy/deploy-matrixone-single-with-s3.md index 295b91bf6..106e183d5 100644 --- a/docs/MatrixOne/Deploy/deploy-matrixone-single-with-s3.md +++ b/docs/MatrixOne/Deploy/deploy-matrixone-single-with-s3.md @@ -736,7 +736,7 @@ cnservices = [ ```bash #Configure cn.toml, tn.toml and log.toml first. -mo_ctl set_conf MO_CONTAINER_IMAGE=matrixorigin/matrixone/2.0.0 #Setting up mirroring +mo_ctl set_conf MO_CONTAINER_IMAGE=matrixorigin/matrixone/2.0.1 #Setting up mirroring mo_ctl set_conf MO_CONTAINER_NAME=mo # Setting the container name mo_ctl set_conf MO_CONTAINER_CONF_HOST_PATH=/data/mo_confs/ # Set the directory on the host machine where the mo configuration file is stored mo_ctl set_conf MO_CONTAINER_CONF_CON_FILE="/etc/launch.toml" # Set the path to the configuration file inside the container when the container starts up diff --git a/docs/MatrixOne/Deploy/update-MatrixOne-cluster.md b/docs/MatrixOne/Deploy/update-MatrixOne-cluster.md index be6a63ab6..d4c1e6a30 100644 --- a/docs/MatrixOne/Deploy/update-MatrixOne-cluster.md +++ b/docs/MatrixOne/Deploy/update-MatrixOne-cluster.md @@ -69,7 +69,7 @@ According to the introduction in [MatrixOne Distributed Cluster Deployment](depl root@master0 ~]# mysql -h $(kubectl get svc/mo-tp-cn -n mo-hn -o jsonpath='{.spec.clusterIP}') -P 6001 -uroot -p111 Welcome to the MariaDB monitor. Commands end with ; or \g. Your MySQL connection id is 1005 - Server version: 8.0.30-MatrixOne-v2.0.0 MatrixOne + Server version: 8.0.30-MatrixOne-v2.0.1 MatrixOne Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others. diff --git a/docs/MatrixOne/Develop/connect-mo/configure-mo-ssl-connection.md b/docs/MatrixOne/Develop/connect-mo/configure-mo-ssl-connection.md index a864b120a..93f68ff8a 100644 --- a/docs/MatrixOne/Develop/connect-mo/configure-mo-ssl-connection.md +++ b/docs/MatrixOne/Develop/connect-mo/configure-mo-ssl-connection.md @@ -83,7 +83,7 @@ To test the SSL configuration, perform the following steps: Current pager: stdout Using outfile: '' Using delimiter: ; - Server version: 8.0.30-MatrixOne-v2.0.0 MatrixOne + Server version: 8.0.30-MatrixOne-v2.0.1 MatrixOne Protocol version: 10 Connection: 127.0.0.1 via TCP/IP Client characterset: utf8mb4 diff --git a/docs/MatrixOne/Develop/connect-mo/database-client-tools.md b/docs/MatrixOne/Develop/connect-mo/database-client-tools.md index 85b383e01..5cf9c4d78 100644 --- a/docs/MatrixOne/Develop/connect-mo/database-client-tools.md +++ b/docs/MatrixOne/Develop/connect-mo/database-client-tools.md @@ -41,7 +41,7 @@ Make sure you have already [installed and launched MatrixOne](../../Get-Started/ ``` Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 1031 - Server version: 8.0.30-MatrixOne-v2.0.0 MatrixOne + Server version: 8.0.30-MatrixOne-v2.0.1 MatrixOne Copyright (c) 2000, 2022, Oracle and/or its affiliates. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. diff --git a/docs/MatrixOne/Develop/connect-mo/python-connect-to-matrixone.md b/docs/MatrixOne/Develop/connect-mo/python-connect-to-matrixone.md index d3f771208..e5db800e9 100644 --- a/docs/MatrixOne/Develop/connect-mo/python-connect-to-matrixone.md +++ b/docs/MatrixOne/Develop/connect-mo/python-connect-to-matrixone.md @@ -69,7 +69,7 @@ The PyMySQL is a pure-Python MySQL client library. ``` > python3 pymysql_connect_matrixone.py - Database version : 8.0.30-MatrixOne-v2.0.0 + Database version : 8.0.30-MatrixOne-v2.0.1 ``` ## Using sqlalchemy connect to MatrixOne diff --git a/docs/MatrixOne/Develop/export-data/select-into-outfile.md b/docs/MatrixOne/Develop/export-data/select-into-outfile.md index 2af58f773..deca19d7e 100644 --- a/docs/MatrixOne/Develop/export-data/select-into-outfile.md +++ b/docs/MatrixOne/Develop/export-data/select-into-outfile.md @@ -48,7 +48,7 @@ mysql> SELECT * FROM TEST INTO OUTFILE '/root/test.csv' If you installed MatrixOne via `docker`, the export directory is located in the docker image by default. If you need to mount a local directory, see the following code example: the local file system path *${local_data_path}/mo-data*is mounted into the MatrixOne Docker image and mapped to the */mo-data*path. For more information, see the [Docker Mount Volume tutorial](https://www.freecodecamp.org/news/docker-mount-volume-guide-how-to-mount-a-local-directory/). ``` -sudo docker run --name --privileged -d -p 6001:6001 -v ${local_data_path}/mo-data:/mo-data:rw matrixorigin/matrixone:2.0.0 +sudo docker run --name --privileged -d -p 6001:6001 -v ${local_data_path}/mo-data:/mo-data:rw matrixorigin/matrixone:2.0.1 ``` ### Steps diff --git a/docs/MatrixOne/Develop/import-data/bulk-load/load-csv.md b/docs/MatrixOne/Develop/import-data/bulk-load/load-csv.md index b2f6ef17b..d71912ad6 100644 --- a/docs/MatrixOne/Develop/import-data/bulk-load/load-csv.md +++ b/docs/MatrixOne/Develop/import-data/bulk-load/load-csv.md @@ -104,7 +104,7 @@ __Note__: A `csv`(comma-separated values) file is a delimited text file that use ### Example using `Load data` with `docker` version If you install MatrixOne by `docker`, the file system is inside the docker image by default. To work with local directory, you need to bind a local directory to the container. In the following example, the local file system path `~/tmp/docker_loaddata_demo/` is binded to the MatrixOne docker image, with a mapping to the `/ssb-dbgen-path` path inside the docker. -We will walk you through the whole process of loading data with MatrixOne 2.0.0 docker version in this example. +We will walk you through the whole process of loading data with MatrixOne 2.0.1 docker version in this example. 1. Download the dataset file and store the data in *~/tmp/docker_loaddata_demo/*: @@ -122,7 +122,7 @@ We will walk you through the whole process of loading data with MatrixOne 2.0.0 3. Use Docker to launch MatrixOne, and mount the directory *~/tmp/docker_loaddata_demo/* that stores data files to a directory in the container. The container directory is */sb-dbgen-path* as an example: ``` - sudo docker run --name matrixone --privileged -d -p 6001:6001 -v ~/tmp/docker_loaddata_demo/:/ssb-dbgen-path:rw matrixorigin/matrixone:2.0.0 + sudo docker run --name matrixone --privileged -d -p 6001:6001 -v ~/tmp/docker_loaddata_demo/:/ssb-dbgen-path:rw matrixorigin/matrixone:2.0.1 ``` 4. Connect to MatrixOne server: diff --git a/docs/MatrixOne/Develop/import-data/bulk-load/using-source.md b/docs/MatrixOne/Develop/import-data/bulk-load/using-source.md index 5c6ec174b..403eb31cd 100644 --- a/docs/MatrixOne/Develop/import-data/bulk-load/using-source.md +++ b/docs/MatrixOne/Develop/import-data/bulk-load/using-source.md @@ -66,6 +66,6 @@ select * from tool; ## Constraints -MatrixOne v24.2.0.0 version already supports MySQL table creation statements, so you can smoothly migrate MySQL tables to MatrixOne. However, it should be noted that during the migration process, some keywords incompatible with MySQL, such as `engine=`, will be automatically ignored in MatrixOne and will not affect the migration of the table structure. +MatrixOne v24.2.0.1 version already supports MySQL table creation statements, so you can smoothly migrate MySQL tables to MatrixOne. However, it should be noted that during the migration process, some keywords incompatible with MySQL, such as `engine=`, will be automatically ignored in MatrixOne and will not affect the migration of the table structure. However, it should be noted that although MatrixOne supports MySQL table creation statements, manual modification is still required if the migrated table contains incompatible data types, triggers, functions, or stored procedures. For more detailed compatibility information, see [MySQL Compatibility](../../../Overview/feature/mysql-compatibility.md). diff --git a/docs/MatrixOne/FAQs/product-faqs.md b/docs/MatrixOne/FAQs/product-faqs.md index db712ac3c..fbcc3e63b 100644 --- a/docs/MatrixOne/FAQs/product-faqs.md +++ b/docs/MatrixOne/FAQs/product-faqs.md @@ -29,7 +29,7 @@ Both MatrixOne 0.8.0 and above can be upgraded directly from a lower version to Is MatrixOne stable **now? Which version is recommended?** -MatrixOne is now available in version v24.2.0.0. We've done a lot of optimization work on stability, and it's ready to be used in the production business. +MatrixOne is now available in version v24.2.0.1. We've done a lot of optimization work on stability, and it's ready to be used in the production business. **Is there a cloud version of MatrixOne? Want a quick test to see**. diff --git a/docs/MatrixOne/Get-Started/install-on-linux/install-on-linux-method1.md b/docs/MatrixOne/Get-Started/install-on-linux/install-on-linux-method1.md index 98d4b7505..5153ed80d 100644 --- a/docs/MatrixOne/Get-Started/install-on-linux/install-on-linux-method1.md +++ b/docs/MatrixOne/Get-Started/install-on-linux/install-on-linux-method1.md @@ -184,7 +184,7 @@ GCC_VERSION="8.5.0" CLANG_VERSION="13.0" GO_VERSION="1.22" MO_GIT_URL="https://github.com/matrixorigin/matrixone.git" -MO_DEFAULT_VERSION="v2.0.0" +MO_DEFAULT_VERSION="v2.0.1" GOPROXY="https://goproxy.cn,direct" STOP_INTERVAL="5" START_INTERVAL="2" @@ -200,7 +200,7 @@ Generally, the parameters that need to be adjusted are as follows: ```` mo_ctl set_conf MO_PATH="yourpath" # Set custom MatrixOne download path mo_ctl set_conf MO_GIT_URL="https://githubfast.com/matrixorigin/matrixone.git" # For the problem of slow downloading from the original GitHub address, set image download address -mo_ctl set_conf MO_DEFAULT_VERSION="v2.0.0" # Set the version of MatrixOne downloaded +mo_ctl set_conf MO_DEFAULT_VERSION="v2.0.1" # Set the version of MatrixOne downloaded mo_ctl set_conf MO_DEPLOY_MODE=git # Deployment Configuration ```` @@ -219,7 +219,7 @@ Depending on your needs, choose whether you want to keep your code up to date, o === "Get the MatrixOne(Stable Version) code to build" ``` - mo_ctl deploy v2.0.0 + mo_ctl deploy v2.0.1 ``` ## Step 4: Launch MatrixOne server @@ -256,7 +256,7 @@ root@VM-16-2-debian:~# mo_ctl connect mysql: [Warning] Using a password on the command line interface can be insecure. Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 15 -Server version: 8.0.30-MatrixOne-v2.0.0 MatrixOne +Server version: 8.0.30-MatrixOne-v2.0.1 MatrixOne Copyright (c) 2000, 2023, Oracle and/or its affiliates. diff --git a/docs/MatrixOne/Get-Started/install-on-linux/install-on-linux-method2.md b/docs/MatrixOne/Get-Started/install-on-linux/install-on-linux-method2.md index 2806ee856..c4f68039a 100644 --- a/docs/MatrixOne/Get-Started/install-on-linux/install-on-linux-method2.md +++ b/docs/MatrixOne/Get-Started/install-on-linux/install-on-linux-method2.md @@ -96,16 +96,16 @@ The Debian11.1 version does not have MySQL Client installed by default, so it ne ```bash mkdir -p /root/matrixone & cd /root/ - wget https://github.com/matrixorigin/matrixone/releases/download/v2.0.0/mo-v2.0.0-linux-x86_64.zip - unzip -d matrixone/ mo-v2.0.0-linux-x86_64.zip + wget https://github.com/matrixorigin/matrixone/releases/download/v2.0.1/mo-v2.0.1-linux-x86_64.zip + unzip -d matrixone/ mo-v2.0.1-linux-x86_64.zip ``` Binary for ARM architecture system: ```bash mkdir -p /root/matrixone & cd /root/ - wget https://github.com/matrixorigin/matrixone/releases/download/v2.0.0/mo-v2.0.0-linux-arm64.zip - unzip -d matrixone/ mo-v2.0.0-linux-arm64.zip + wget https://github.com/matrixorigin/matrixone/releases/download/v2.0.1/mo-v2.0.1-linux-arm64.zip + unzip -d matrixone/ mo-v2.0.1-linux-arm64.zip ``` === "**Downloading method 2: Using `curl` to install binary packages**" @@ -114,21 +114,21 @@ The Debian11.1 version does not have MySQL Client installed by default, so it ne ```bash mkdir -p /root/matrixone & cd /root/ - curl -OL https://github.com/matrixorigin/matrixone/releases/download/v2.0.0/mo-v2.0.0-linux-x86_64.zip - unzip -d matrixone/ mo-v2.0.0-linux-x86_64.zip + curl -OL https://github.com/matrixorigin/matrixone/releases/download/v2.0.1/mo-v2.0.1-linux-x86_64.zip + unzip -d matrixone/ mo-v2.0.1-linux-x86_64.zip ``` Binary for ARM architecture system: ```bash mkdir -p /root/matrixone & cd /root/ - curl -OL https://github.com/matrixorigin/matrixone/releases/download/v2.0.0/mo-v2.0.0-linux-arm64.zip - unzip -d matrixone/ mo-v2.0.0-linux-arm64.zip + curl -OL https://github.com/matrixorigin/matrixone/releases/download/v2.0.1/mo-v2.0.1-linux-arm64.zip + unzip -d matrixone/ mo-v2.0.1-linux-arm64.zip ``` === "**Downloading method 3: Go to the page and download**" - If you want a more intuitive way to download the page, go to the [version 2.0.0](https://github.com/matrixorigin/matrixone/releases/tag/v2.0.0), pull down to find the **Assets** column, and click the installation package *mo-v2.0.0-linux-x86_64.zip* or *mo-v2.0.0-linux-arm64.zip* can be downloaded. + If you want a more intuitive way to download the page, go to the [version 2.0.1](https://github.com/matrixorigin/matrixone/releases/tag/v2.0.1), pull down to find the **Assets** column, and click the installation package *mo-v2.0.1-linux-x86_64.zip* or *mo-v2.0.1-linux-arm64.zip* can be downloaded. ## Step 3: Install the mo_ctl tool @@ -147,8 +147,8 @@ wget https://raw.githubusercontent.com/matrixorigin/mo_ctl_standalone/main/insta The parameters that need to be adjusted are as follows: ```` -mo_ctl set_conf MO_PATH="/yourpath/mo-v2.0.0-xx-xx" # Set the MO_PATH to the directory where the binary files are extracted -mo_ctl set_conf MO_CONF_FILE="/yourpath/mo-v2.0.0-xx-xx/etc/launch/launch.toml" # Set the MO_CONF_FILE path +mo_ctl set_conf MO_PATH="/yourpath/mo-v2.0.1-xx-xx" # Set the MO_PATH to the directory where the binary files are extracted +mo_ctl set_conf MO_CONF_FILE="/yourpath/mo-v2.0.1-xx-xx/etc/launch/launch.toml" # Set the MO_CONF_FILE path mo_ctl set_conf MO_DEPLOY_MODE=binary #Deployment Configuration ```` @@ -156,17 +156,17 @@ mo_ctl set_conf MO_DEPLOY_MODE=binary #Deployment Configuration Launch the MatrixOne service through the `mo_ctl start` command. -If the operation is regular, the following log will appear. The relevant operation logs of MatrixOne will be in `/yourpath/mo-v2.0.0-xx-xx/matrixone/logs/`. +If the operation is regular, the following log will appear. The relevant operation logs of MatrixOne will be in `/yourpath/mo-v2.0.1-xx-xx/matrixone/logs/`. ``` root@VM-16-2-debian:~# mo_ctl start 2024-03-07 14:34:04.942 UTC+0800 [INFO] No mo-service is running 2024-03-07 14:34:04.998 UTC+0800 [INFO] Get conf succeeded: MO_DEPLOY_MODE="binary" 2024-03-07 14:34:05.024 UTC+0800 [INFO] GO memory limit(Mi): 14745 -2024-03-07 14:34:05.072 UTC+0800 [INFO] Starting mo-service: cd /Users/admin/mo-v2.0.0-linux-arm64/ && GOMEMLIMIT=14745MiB /Users/admin/mo-v2.0.0-linux-arm64/mo-service -daemon -debug-http :9876 -launch /Users/admin/mo-v2.0.0-linux-arm64/etc/launch/launch.toml >/Users/admin/mo-v2.0.0-linux-arm64/matrixone/logs/stdout-20240307_143405.log 2>/Users/admin/mo-v2.0.0-linux-arm64/matrixone/logs/stderr-20240307_143405.log +2024-03-07 14:34:05.072 UTC+0800 [INFO] Starting mo-service: cd /Users/admin/mo-v2.0.1-linux-arm64/ && GOMEMLIMIT=14745MiB /Users/admin/mo-v2.0.1-linux-arm64/mo-service -daemon -debug-http :9876 -launch /Users/admin/mo-v2.0.1-linux-arm64/etc/launch/launch.toml >/Users/admin/mo-v2.0.1-linux-arm64/matrixone/logs/stdout-20240307_143405.log 2>/Users/admin/mo-v2.0.1-linux-arm64/matrixone/logs/stderr-20240307_143405.log 2024-03-07 14:34:05.137 UTC+0800 [INFO] Wait for 2 seconds 2024-03-07 14:34:07.261 UTC+0800 [INFO] At least one mo-service is running. Process info: - 501 27145 1 0 2:34下午 ?? 0:00.18 /Users/admin/mo-v2.0.0-linux-arm64/mo-service -daemon -debug-http :9876 -launch /Users/admin/mo-v2.0.0-linux-arm64/etc/launch/launch.toml + 501 27145 1 0 2:34下午 ?? 0:00.18 /Users/admin/mo-v2.0.1-linux-arm64/mo-service -daemon -debug-http :9876 -launch /Users/admin/mo-v2.0.1-linux-arm64/etc/launch/launch.toml 2024-03-07 14:34:07.284 UTC+0800 [INFO] List of pid(s): 27145 2024-03-07 14:34:07.308 UTC+0800 [INFO] Start succeeded @@ -188,7 +188,7 @@ root@VM-16-2-debian:~# mo_ctl connect 2024-03-07 14:34:59.942 UTC+0800 [INFO] Ok, connecting for user ... Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 426 -Server version: 8.0.30-MatrixOne-v2.0.0 MatrixOne +Server version: 8.0.30-MatrixOne-v2.0.1 MatrixOne Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. diff --git a/docs/MatrixOne/Get-Started/install-on-linux/install-on-linux-method3.md b/docs/MatrixOne/Get-Started/install-on-linux/install-on-linux-method3.md index 0041d8f84..290f943e8 100644 --- a/docs/MatrixOne/Get-Started/install-on-linux/install-on-linux-method3.md +++ b/docs/MatrixOne/Get-Started/install-on-linux/install-on-linux-method3.md @@ -67,18 +67,18 @@ Create and run the container of MatrixOne It will pull the image from Docker Hub if not exists. You can choose to pull the stable version image or the develop version image. -=== "Stable Version Image(2.0.0 version)" +=== "Stable Version Image(2.0.1 version)" ```bash - docker pull matrixorigin/matrixone:2.0.0 - docker run -d -p 6001:6001 --name matrixone matrixorigin/matrixone:2.0.0 + docker pull matrixorigin/matrixone:2.0.1 + docker run -d -p 6001:6001 --name matrixone matrixorigin/matrixone:2.0.1 ``` If you are using the network in mainland China, you can pull the MatrixOne stable version image on Alibaba Cloud: ```bash - docker pull registry.cn-shanghai.aliyuncs.com/matrixorigin/matrixone:2.0.0 - docker run -d -p 6001:6001 --name matrixone registry.cn-shanghai.aliyuncs.com/matrixorigin/matrixone:2.0.0 + docker pull registry.cn-shanghai.aliyuncs.com/matrixorigin/matrixone:2.0.1 + docker run -d -p 6001:6001 --name matrixone registry.cn-shanghai.aliyuncs.com/matrixorigin/matrixone:2.0.1 ``` === "Develop Version Image" @@ -102,7 +102,7 @@ It will pull the image from Docker Hub if not exists. You can choose to pull the If your Docker version is lower than 20.10.18 or the Docker client and server versions are inconsistent, upgrading to the latest stable version before attempting is recommended. If you choose to proceed with the current versions, you need to add the parameter `--privileged=true` to the `docker run` command, as shown below: ```bash -docker run -d -p 6001:6001 --name matrixone --privileged=true matrixorigin/matrixone:2.0.0 +docker run -d -p 6001:6001 --name matrixone --privileged=true matrixorigin/matrixone:2.0.1 ``` !!! note @@ -160,7 +160,7 @@ Depending on your needs, choose whether you want to keep your code up to date, o === "Get the MatrixOne(Stable Version) code to build" ``` - mo_ctl deploy v2.0.0 + mo_ctl deploy v2.0.1 ``` - Launch MatrixOne server @@ -198,7 +198,7 @@ root@VM-16-2-debian:~# mo_ctl connect mysql: [Warning] Using a password on the command line interface can be insecure. Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 15 -Server version: 8.0.30-MatrixOne-v2.0.0 MatrixOne +Server version: 8.0.30-MatrixOne-v2.0.1 MatrixOne Copyright (c) 2000, 2023, Oracle and/or its affiliates. diff --git a/docs/MatrixOne/Get-Started/install-on-macos/install-on-macos-method1.md b/docs/MatrixOne/Get-Started/install-on-macos/install-on-macos-method1.md index 7df8c6c34..2212795a7 100644 --- a/docs/MatrixOne/Get-Started/install-on-macos/install-on-macos-method1.md +++ b/docs/MatrixOne/Get-Started/install-on-macos/install-on-macos-method1.md @@ -170,7 +170,7 @@ GCC_VERSION="8.5.0" CLANG_VERSION="13.0" GO_VERSION="1.22" MO_GIT_URL="https://github.com/matrixorigin/matrixone.git" -MO_DEFAULT_VERSION="v2.0.0" +MO_DEFAULT_VERSION="v2.0.1" GOPROXY="https://goproxy.cn,direct" STOP_INTERVAL="5" START_INTERVAL="2" @@ -205,7 +205,7 @@ Depending on your needs, choose whether you want to keep your code up to date, o === "Get the MatrixOne(Stable Version) code to build" ``` - mo_ctl deploy v2.0.0 + mo_ctl deploy v2.0.1 ``` ## Step 4: Launch MatrixOne server @@ -242,7 +242,7 @@ This command will invoke the MySQL Client tool to connect to the MatrixOne servi mysql: [Warning] Using a password on the command line interface can be insecure. Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 15 -Server version: 8.0.30-MatrixOne-v2.0.0 MatrixOne +Server version: 8.0.30-MatrixOne-v2.0.1 MatrixOne Copyright (c) 2000, 2023, Oracle and/or its affiliates. diff --git a/docs/MatrixOne/Get-Started/install-on-macos/install-on-macos-method2.md b/docs/MatrixOne/Get-Started/install-on-macos/install-on-macos-method2.md index e9caac15f..abcd31e80 100644 --- a/docs/MatrixOne/Get-Started/install-on-macos/install-on-macos-method2.md +++ b/docs/MatrixOne/Get-Started/install-on-macos/install-on-macos-method2.md @@ -98,16 +98,16 @@ __Tips__: It is recommended that you download and install one of these two tools ```bash mkdir -p /User/username/mo/matrixone & cd /User/username/mo - wget https://github.com/matrixorigin/matrixone/releases/download/v2.0.0/mo-v2.0.0-darwin-x86_64.zip - unzip -d matrixone/ mo-v2.0.0-darwin-x86_64.zip + wget https://github.com/matrixorigin/matrixone/releases/download/v2.0.1/mo-v2.0.1-darwin-x86_64.zip + unzip -d matrixone/ mo-v2.0.1-darwin-x86_64.zip ``` Binary for ARM architecture system: ```bash mkdir -p /User/username/mo/matrixone & cd /User/username/mo - wget https://github.com/matrixorigin/matrixone/releases/download/v2.0.0/mo-v2.0.0-darwin-arm64.zip - unzip -d matrixone/ mo-v2.0.0-darwin-arm64.zip + wget https://github.com/matrixorigin/matrixone/releases/download/v2.0.1/mo-v2.0.1-darwin-arm64.zip + unzip -d matrixone/ mo-v2.0.1-darwin-arm64.zip ``` === "**Downloading method 2: Using `curl` to install binary packages**" @@ -116,21 +116,21 @@ __Tips__: It is recommended that you download and install one of these two tools ```bash mkdir -p /User/username/mo/matrixone & cd /User/username/mo - curl -OL https://github.com/matrixorigin/matrixone/releases/download/v2.0.0/mo-v2.0.0-darwin-x86_64.zip - unzip -d matrixone/ mo-v2.0.0-darwin-x86_64.zip + curl -OL https://github.com/matrixorigin/matrixone/releases/download/v2.0.1/mo-v2.0.1-darwin-x86_64.zip + unzip -d matrixone/ mo-v2.0.1-darwin-x86_64.zip ``` Binary for ARM architecture system: ```bash mkdir -p /User/username/mo/matrixone & cd /User/username/mo - curl -OL https://github.com/matrixorigin/matrixone/releases/download/v2.0.0/mo-v2.0.0-darwin-arm64.zip + curl -OL https://github.com/matrixorigin/matrixone/releases/download/v2.0.1/mo-v2.0.1-darwin-arm64.zip unzip -d matrixone/ mo-v-darwin-arm64.zip ``` === "**Downloading method 3: Go to the page and download**" - If you want a more intuitive way to download the page, go to the [version 2.0.0](https://github.com/matrixorigin/matrixone/releases/tag/v2.0.0), pull down to find the **Assets** column, and click the installation package *mo-v2.0.0-darwin-x86_64.zip* or *mo-v2.0.0-darwin-arm64.zip* can be downloaded. + If you want a more intuitive way to download the page, go to the [version 2.0.1](https://github.com/matrixorigin/matrixone/releases/tag/v2.0.1), pull down to find the **Assets** column, and click the installation package *mo-v2.0.1-darwin-x86_64.zip* or *mo-v2.0.1-darwin-arm64.zip* can be downloaded. ## Step 3: Install the mo_ctl tool @@ -149,8 +149,8 @@ wget https://raw.githubusercontent.com/matrixorigin/mo_ctl_standalone/main/insta The parameters that need to be adjusted are as follows: ```` -mo_ctl set_conf MO_PATH="/yourpath/mo-v2.0.0-xx-xx" # Set the MO_PATH to the directory where the binary files are extracted -mo_ctl set_conf MO_CONF_FILE="/yourpath/mo-v2.0.0-xx-xx/etc/launch/launch.toml" # Set the MO_CONF_FILE path +mo_ctl set_conf MO_PATH="/yourpath/mo-v2.0.1-xx-xx" # Set the MO_PATH to the directory where the binary files are extracted +mo_ctl set_conf MO_CONF_FILE="/yourpath/mo-v2.0.1-xx-xx/etc/launch/launch.toml" # Set the MO_CONF_FILE path mo_ctl set_conf MO_DEPLOY_MODE=binary #Deployment Configuration ```` @@ -158,17 +158,17 @@ mo_ctl set_conf MO_DEPLOY_MODE=binary #Deployment Configuration Launch the MatrixOne service through the `mo_ctl start` command. -If the operation is regular, the following log will appear. The relevant operation logs of MatrixOne will be in `/yourpath/mo-v2.0.0-xx-xx/matrixone/logs/ . +If the operation is regular, the following log will appear. The relevant operation logs of MatrixOne will be in `/yourpath/mo-v2.0.1-xx-xx/matrixone/logs/ . ``` > mo_ctl start 2024-03-07 14:34:04.942 UTC+0800 [INFO] No mo-service is running 2024-03-07 14:34:04.998 UTC+0800 [INFO] Get conf succeeded: MO_DEPLOY_MODE="binary" 2024-03-07 14:34:05.024 UTC+0800 [INFO] GO memory limit(Mi): 14745 -2024-03-07 14:34:05.072 UTC+0800 [INFO] Starting mo-service: cd /Users/admin/mo-v2.0.0-darwin-arm64/ && GOMEMLIMIT=14745MiB /Users/admin/mo-v2.0.0-darwin-arm64/mo-service -daemon -debug-http :9876 -launch /Users/admin/mo-v2.0.0-darwin-arm64/etc/launch/launch.toml >/Users/admin/mo-v2.0.0-darwin-arm64/matrixone/logs/stdout-20240307_143405.log 2>/Users/admin/mo-v2.0.0-darwin-arm64/matrixone/logs/stderr-20240307_143405.log +2024-03-07 14:34:05.072 UTC+0800 [INFO] Starting mo-service: cd /Users/admin/mo-v2.0.1-darwin-arm64/ && GOMEMLIMIT=14745MiB /Users/admin/mo-v2.0.1-darwin-arm64/mo-service -daemon -debug-http :9876 -launch /Users/admin/mo-v2.0.1-darwin-arm64/etc/launch/launch.toml >/Users/admin/mo-v2.0.1-darwin-arm64/matrixone/logs/stdout-20240307_143405.log 2>/Users/admin/mo-v2.0.1-darwin-arm64/matrixone/logs/stderr-20240307_143405.log 2024-03-07 14:34:05.137 UTC+0800 [INFO] Wait for 2 seconds 2024-03-07 14:34:07.261 UTC+0800 [INFO] At least one mo-service is running. Process info: - 501 27145 1 0 2:34下午 ?? 0:00.18 /Users/admin/mo-v2.0.0-darwin-arm64/mo-service -daemon -debug-http :9876 -launch /Users/admin/mo-v2.0.0-darwin-arm64/etc/launch/launch.toml + 501 27145 1 0 2:34下午 ?? 0:00.18 /Users/admin/mo-v2.0.1-darwin-arm64/mo-service -daemon -debug-http :9876 -launch /Users/admin/mo-v2.0.1-darwin-arm64/etc/launch/launch.toml 2024-03-07 14:34:07.284 UTC+0800 [INFO] List of pid(s): 27145 2024-03-07 14:34:07.308 UTC+0800 [INFO] Start succeeded @@ -190,7 +190,7 @@ This command will invoke the MySQL Client tool to connect to the MatrixOne servi 2024-03-07 14:34:59.942 UTC+0800 [INFO] Ok, connecting for user ... Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 426 -Server version: 8.0.30-MatrixOne-v2.0.0 MatrixOne +Server version: 8.0.30-MatrixOne-v2.0.1 MatrixOne Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. diff --git a/docs/MatrixOne/Get-Started/install-on-macos/install-on-macos-method3.md b/docs/MatrixOne/Get-Started/install-on-macos/install-on-macos-method3.md index bf8b3af0e..1d066c252 100644 --- a/docs/MatrixOne/Get-Started/install-on-macos/install-on-macos-method3.md +++ b/docs/MatrixOne/Get-Started/install-on-macos/install-on-macos-method3.md @@ -59,18 +59,18 @@ Create and run the container of MatrixOne It will pull the image from Docker Hub if not exists. You can choose to pull the stable version image or the develop version image. -=== "Stable Version Image(2.0.0 version)" +=== "Stable Version Image(2.0.1 version)" ```bash - docker pull matrixorigin/matrixone:2.0.0 - docker run -d -p 6001:6001 --name matrixone matrixorigin/matrixone:2.0.0 + docker pull matrixorigin/matrixone:2.0.1 + docker run -d -p 6001:6001 --name matrixone matrixorigin/matrixone:2.0.1 ``` If you are using the network in mainland China, you can pull the MatrixOne stable version image on Alibaba Cloud: ```bash - docker pull registry.cn-shanghai.aliyuncs.com/matrixorigin/matrixone:2.0.0 - docker run -d -p 6001:6001 --name matrixone registry.cn-shanghai.aliyuncs.com/matrixorigin/matrixone:2.0.0 + docker pull registry.cn-shanghai.aliyuncs.com/matrixorigin/matrixone:2.0.1 + docker run -d -p 6001:6001 --name matrixone registry.cn-shanghai.aliyuncs.com/matrixorigin/matrixone:2.0.1 ``` === "Develop Version Image" @@ -94,7 +94,7 @@ It will pull the image from Docker Hub if not exists. You can choose to pull the If your Docker version is lower than 20.10.18 or the Docker client and server versions are inconsistent, upgrading to the latest stable version before attempting is recommended. If you choose to proceed with the current versions, you need to add the parameter `--privileged=true` to the `docker run` command, as shown below: ```bash -docker run -d -p 6001:6001 --name matrixone --privileged=true matrixorigin/matrixone:2.0.0 +docker run -d -p 6001:6001 --name matrixone --privileged=true matrixorigin/matrixone:2.0.1 ``` !!! note @@ -120,7 +120,7 @@ The parameters that need to be adjusted are as follows: ``` mo_ctl set_conf MO_CONTAINER_DATA_HOST_PATH="/yourpath/mo/" # Set the data directory for host -mo_ctl set_conf MO_CONTAINER_IMAGE="matrixorigin/matrixone:2.0.0" # Set image +mo_ctl set_conf MO_CONTAINER_IMAGE="matrixorigin/matrixone:2.0.1" # Set image mo_ctl set_conf MO_DEPLOY_MODE=docker # Deployment Configuration ``` @@ -152,7 +152,7 @@ Depending on your needs, choose whether you want to keep your code up to date, o === "Get the MatrixOne(Stable Version) code to build" ``` - mo_ctl deploy v2.0.0 + mo_ctl deploy v2.0.1 ``` - Launch MatrixOne server @@ -190,7 +190,7 @@ root@VM-16-2-debian:~# mo_ctl connect mysql: [Warning] Using a password on the command line interface can be insecure. Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 15 -Server version: 8.0.30-MatrixOne-v2.0.0 MatrixOne +Server version: 8.0.30-MatrixOne-v2.0.1 MatrixOne Copyright (c) 2000, 2023, Oracle and/or its affiliates. diff --git a/docs/MatrixOne/Maintain/mount-data-by-docker.md b/docs/MatrixOne/Maintain/mount-data-by-docker.md index 92e4ebebe..93e28d3c5 100644 --- a/docs/MatrixOne/Maintain/mount-data-by-docker.md +++ b/docs/MatrixOne/Maintain/mount-data-by-docker.md @@ -24,7 +24,7 @@ To ensure the safety of the data directory, mount the local data directory to th 3. Mount the local **empty directory** to the Docker container directory */mo-data*, execute the following command: ```shell - sudo docker run --name --privileged -d -p 6001:6001 -v ${local_data_path}/mo-data:/mo-data:rw matrixorigin/matrixone:2.0.0 + sudo docker run --name --privileged -d -p 6001:6001 -v ${local_data_path}/mo-data:/mo-data:rw matrixorigin/matrixone:2.0.1 ``` | Parameters | Description | @@ -46,7 +46,7 @@ If you need to modify the configuration file. In that case, it would be best to 2. To launch MatrixOne MatrixOne has not been running in Docker, execute the following command: ``` - docker run -d -p 6001:6001 --name matrixone --privileged=true matrixorigin/matrixone:2.0.0 + docker run -d -p 6001:6001 --name matrixone --privileged=true matrixorigin/matrixone:2.0.1 ``` 3. Check the containerID that MatrixOne has been running in Docker, and copy the configuration file directory to the local directory: @@ -68,7 +68,7 @@ If you need to modify the configuration file. In that case, it would be best to 6. Mount the configuration file to the Docker container directory and launch MatrixOne. Execute the following command: ```shell - sudo docker run --name --privileged -d -p 6001:6001 -v ${local_config_path}/etc:/etc:rw --entrypoint "/mo-service" matrixorigin/matrixone:2.0.0 -launch /etc/launch/launch.toml + sudo docker run --name --privileged -d -p 6001:6001 -v ${local_config_path}/etc:/etc:rw --entrypoint "/mo-service" matrixorigin/matrixone:2.0.1 -launch /etc/launch/launch.toml ``` | Parameters | Description | diff --git a/docs/MatrixOne/Overview/whats-new.md b/docs/MatrixOne/Overview/whats-new.md index 17bc4752a..5127d41cd 100644 --- a/docs/MatrixOne/Overview/whats-new.md +++ b/docs/MatrixOne/Overview/whats-new.md @@ -1,5 +1,5 @@ # **What's New** -The lastest version of MatrixOne is v24.2.0.0, releases on 01th November, 2024. See the following: +The lastest version of MatrixOne is v24.2.0.1, releases on 10th December, 2024. See the following: -* [v24.2.0.0 Release Notes](../Release-Notes/v24.2.0.0.md) +* [v24.2.0.1 Release Notes](../Release-Notes/v24.2.0.1.md) diff --git a/docs/MatrixOne/Reference/Data-Types/datalink-type.md b/docs/MatrixOne/Reference/Data-Types/datalink-type.md index 379859b19..667f25a8b 100644 --- a/docs/MatrixOne/Reference/Data-Types/datalink-type.md +++ b/docs/MatrixOne/Reference/Data-Types/datalink-type.md @@ -29,6 +29,9 @@ INSERT INTO TABLE_NAME VALUES ('/>| If you want to read the data pointed by `DATALINK` to a file link, you can use the [load_file](../../Reference/Functions-and-Operators/Other/load_file.md) function. +!!! note + The `load_file()` function reads files in binary mode. For non-text files (such as images, audio, video and other binary format files), the read content will be returned in the form of a raw byte stream without character encoding. Convert. In addition, because in UTF-8 encoding, Chinese characters usually occupy 3 bytes, while English characters only occupy 1 byte. Therefore, when specifying the offset (offset) and read size (size) of the file, if the byte alignment of the characters is not considered, Chinese characters may be truncated or cannot be read correctly, resulting in garbled characters. In order to avoid this situation, the values ​​of offset and size need to be correctly converted according to the character encoding to ensure that the number of bytes of the read content is aligned with the character boundary. + ## Example There is a file `t1.csv` under `/Users/admin/case` diff --git a/docs/MatrixOne/Reference/Functions-and-Operators/Mathematical/crc32.md b/docs/MatrixOne/Reference/Functions-and-Operators/Mathematical/crc32.md new file mode 100644 index 000000000..e21304eba --- /dev/null +++ b/docs/MatrixOne/Reference/Functions-and-Operators/Mathematical/crc32.md @@ -0,0 +1,45 @@ +# **CRC32()** + +## **Function description** + +The CRC32() function is used to calculate the CRC32 checksum of a string. If the argument passed to CRC32() is NULL, the function returns NULL. + +## **Function syntax** + +``` +> CRC32(string) +``` + +## **Parameter explanation** + +| Parameters | Description | +| ----| ----| +| string | Required parameter, input string to calculate CRC32 checksum | + +## **Example** + +```sql +mysql> SELECT CRC32('hello world'); ++--------------------+ +| CRC32(hello world) | ++--------------------+ +| 222957957 | ++--------------------+ +1 row in set (0.00 sec) + +mysql> SELECT CRC32('HELLOW WORLD'); ++---------------------+ +| CRC32(HELLOW WORLD) | ++---------------------+ +| 1290240849 | ++---------------------+ +1 row in set (0.00 sec) + +mysql> SELECT CRC32(NULL); ++-------------+ +| CRC32(null) | ++-------------+ +| NULL | ++-------------+ +1 row in set (0.00 sec) +``` \ No newline at end of file diff --git a/docs/MatrixOne/Reference/Functions-and-Operators/Table/generate_series.md b/docs/MatrixOne/Reference/Functions-and-Operators/Table/generate_series.md new file mode 100644 index 000000000..32082e339 --- /dev/null +++ b/docs/MatrixOne/Reference/Functions-and-Operators/Table/generate_series.md @@ -0,0 +1,75 @@ +# **GENERATE_SERIES()** + +## **Function description** + +GENERATE_SERIES() can generate a sequence from the start value to the end value, usually used in the following scenarios: + +1. Generate continuous numbers: Used to generate a series of integers, such as 1 to 10. +2. Generate date and time series: time series at daily, hourly and other intervals can be generated. +3. Combined table query: used to dynamically generate or expand data. + +## **Function syntax** + +``` +>select *from generate_series(start, stop [, step]) g +``` + +## **Parameter explanation** + +| Parameters | Description | +| ----| ----| +| start | starting value | +| stop | end value | +| step | step size, default is 1| + +## **Example** + +-Example 1: + +```sql +--Generate a sequence of 1-5 integers +mysql> select *from generate_series(5) g; ++--------+ +| result | ++--------+ +| 1 | +| 2 | +| 3 | +| 4 | +| 5 | ++--------+ +5 rows in set (0.01 sec) + +--Generate a sequence of 2-5 integers +mysql> select *from generate_series(2, 5) g; ++--------+ +| result | ++--------+ +| 2 | +| 3 | +| 4 | +| 5 | ++--------+ +4 rows in set (0.00 sec) + +--Generate a sequence of 1-5 integers and specify a step size of 2 +mysql> select *from generate_series(1, 5,2) g; ++--------+ +| result | ++--------+ +| 1 | +| 3 | +| 5 | ++--------+ +3 rows in set (0.01 sec) + +--Generate date sequence +mysql> select *from generate_series('2020-02-28 00:00:00','2021-03-01 00:01:00', '1 year') g; ++---------------------+ +| result | ++---------------------+ +| 2020-02-28 00:00:00 | +| 2021-02-28 00:00:00 | ++---------------------+ +2 rows in set (0.00 sec) +``` \ No newline at end of file diff --git a/docs/MatrixOne/Reference/Functions-and-Operators/matrixone-function-list.md b/docs/MatrixOne/Reference/Functions-and-Operators/matrixone-function-list.md index a5d669a59..20c507013 100644 --- a/docs/MatrixOne/Reference/Functions-and-Operators/matrixone-function-list.md +++ b/docs/MatrixOne/Reference/Functions-and-Operators/matrixone-function-list.md @@ -69,6 +69,7 @@ This document lists the functions supported in the latest version of MatrixOne. | [CEILING()](./Mathematical/ceiling.md) | Used to find the smallest integer that is not less than the argument.| | [COS()](./Mathematical/cos.md) | Used to find the cosine of an input parameter (expressed in radians).| | [COT()](./Mathematical/cot.md) | Used to find the cotangent value of the input parameter (expressed in radians). | +| [CRC32()](./Mathematical/crc32.md)| Used to calculate a CRC32 checksum for a string | | [EXP()](./Mathematical/exp.md) | Used to find the exponent of number with the natural constant e as the base.| | [FLOOR()](./Mathematical/floor.md)| Used to find the number of digits not greater than the corresponding digit of a number. | | [LN()](./Mathematical/ln.md) | The natural logarithm used to find the parameters| @@ -160,6 +161,7 @@ This document lists the functions supported in the latest version of MatrixOne. | Function name | effect | | -------------------------------- | --------------------------------------- | +| [GENERATE_SERIES()](./Table/generate_series.md) | Used to form a sequence from start value to end value| | [UNNEST()](./Table/unnest.md) | Used to expand an array of columns or parameters within JSON-type data into a table.| ## Window function diff --git a/docs/MatrixOne/Reference/SQL-Reference/Data-Query-Language/apply/cross-apply.md b/docs/MatrixOne/Reference/SQL-Reference/Data-Query-Language/apply/cross-apply.md new file mode 100644 index 000000000..909abbaa1 --- /dev/null +++ b/docs/MatrixOne/Reference/SQL-Reference/Data-Query-Language/apply/cross-apply.md @@ -0,0 +1,32 @@ +# **CROSS APPLY** + +## **Syntax description** + +`CROSS APPLY` is a special join operator in MatrixOne, mainly used to join each row of a table with another table function that returns a result set (such as a table-valued function). Unlike JOIN, CROSS APPLY allows a subquery or table-valued function on the right to depend on each row of the table on the left, returning different results for each row. + +## **Grammar structure** + +``` +> SELECT +FROM +CROSS APPLY ; +``` + +## **Example** + +```sql +mysql> create table t1(a int, b int); +Query OK, 0 rows affected (0.03 sec) + +mysql> insert into t1 values(1,3),(1,-1); +Query OK, 2 rows affected (0.00 sec) +mysql> select *from t1 cross apply generate_series(t1.a,t1.b,1)g; ++------+------+--------+ +| a | b | result | ++------+------+--------+ +| 1 | 3 | 1 | +| 1 | 3 | 2 | +| 1 | 3 | 3 | ++------+------+--------+ +3 rows in set (0.02 sec) +``` \ No newline at end of file diff --git a/docs/MatrixOne/Reference/SQL-Reference/Data-Query-Language/apply/outer-apply.md b/docs/MatrixOne/Reference/SQL-Reference/Data-Query-Language/apply/outer-apply.md new file mode 100644 index 000000000..bd091e988 --- /dev/null +++ b/docs/MatrixOne/Reference/SQL-Reference/Data-Query-Language/apply/outer-apply.md @@ -0,0 +1,33 @@ +# **OUTER APPLY** + +## **Syntax description** + +`OUTER APPLY` is used to dynamically associate each row of the main table with the results of a function or subquery. (The content on the right can be dynamically generated based on the rows of the main table). Unlike [`CROSS APPLY`](./cross-apply.md), even if there is no data on the right side, the records of the main table will not be discarded, but the right column will be filled with NULL. (Similar to the effect of LEFT JOIN, but the right side is dynamically generated data). + +## **Grammar structure** + +``` +> SELECT +FROM +outer APPLY ; +``` + +## **Example** + +```sql +mysql> create table t1(a int, b int); +Query OK, 0 rows affected (0.03 sec) + +mysql> insert into t1 values(1,3),(1,-1); +Query OK, 2 rows affected (0.00 sec) +mysql> select *from t1 outer apply generate_series(t1.a,t1.b,1)g; ++------+------+--------+ +| a | b | result | ++------+------+--------+ +| 1 | 3 | 1 | +| 1 | 3 | 2 | +| 1 | 3 | 3 | +| 1 | -1 | NULL | ++------+------+--------+ +4 rows in set (0.01 sec) +``` \ No newline at end of file diff --git a/docs/MatrixOne/Reference/SQL-Reference/Other/SHOW-Statements/show-account.md b/docs/MatrixOne/Reference/SQL-Reference/Other/SHOW-Statements/show-account.md index 224d69d65..a933eb61a 100644 --- a/docs/MatrixOne/Reference/SQL-Reference/Other/SHOW-Statements/show-account.md +++ b/docs/MatrixOne/Reference/SQL-Reference/Other/SHOW-Statements/show-account.md @@ -1,38 +1,38 @@ # **SHOW ACCOUNTS** -## **Description** +## **Function description** -Lists the meta information and statistics for the accounts created. +Lists meta-information and statistics for tenant users created under your account. -## **Syntax** +## **Function syntax** ``` > SHOW ACCOUNTS; ``` -### Meta information of account +### Tenant user information details -| Column Name | Details | Type | Date Source | -| -------------- | ------------------- | --------------- | -------------------------------------------- | -| ACCOUNT_NAME | Account name | varchar | mo_account | -| ADMIN_NAME | The default administrator name is created | varchar | In the mo_user table under each account | -| CREATED | Created time | timestamp | mo_account | -| STATUS | Status, OPEN or SUSPENDED | varchar | mo_account | -| SUSPENDED_TIME | Suspended time | timestamp | mo_account | -| DB_COUNT | the number of databases | bigint unsigned | mo_tables | -| TABLE_COUNT | the number of tables | bigint unsigned | mo_tables | -| ROW_COUNT | Total line number | bigint unsigned | sum(mo_table_rows()) | -| SIZE | Total space used (MB) | decimal(29,3) | sum(mo_table_size(mt.reldatabase,mt.relname) | -| COMMENT | COMMENT information at creation time | varchar | mo_account | +| Column Name | Information | Type | Data Source | +| --------------| -------------------| ---------------| -----------------------------------------------| +| ACCOUNT_NAME | tenant name | varchar | mo_account | +| ADMIN_NAME | Default super administrator name when created | varchar | In the mo_user table under each tenant | +| CREATED_TIME | Creation time | timestamp | mo_account | +| STATUS | Current status, OPEN or SUSPENDED | varchar | mo_account | +| SUSPENDED_TIME | Suspension time | timestamp | mo_account | +| DB_COUNT | Number of databases | bigint unsigned | mo_tables | +| TBL_COUNT | Number of tables | bigint unsigned | mo_tables | +| SIZE | Total space used (MB) | decimal(29,3) | sum(mo_table_size(mt.reldatabase,mt.relname) | +| SNAPSHOT_SIZE | Backup data storage size (MB) | --| --| +| COMMENTS | COMMENT information when created | varchar | mo_account | -## **Examples** +## **Example** ```sql mysql> show accounts; -+--------------+------------+---------------------+--------+----------------+----------+-------------+-----------+-------+----------------+ -| account_name | admin_name | created | status | suspended_time | db_count | table_count | row_count | size | comment | -+--------------+------------+---------------------+--------+----------------+----------+-------------+-----------+-------+----------------+ -| sys | root | 2023-02-14 06:58:15 | open | NULL | 8 | 57 | 2681 | 0.351 | system account | -+--------------+------------+---------------------+--------+----------------+----------+-------------+-----------+-------+----------------+ -1 row in set (0.14 sec) -``` ++--------------+------------+---------------------+--------+----------------+----------+-----------+----------+---------------+----------------+ +| account_name | admin_name | created_time | status | suspended_time | db_count | tbl_count | size | snapshot_size | comments | ++--------------+------------+---------------------+--------+----------------+----------+-----------+----------+---------------+----------------+ +| sys | root | 2024-12-06 03:37:02 | open | NULL | 7 | 108 | 3.188068 | 0 | system account | ++--------------+------------+---------------------+--------+----------------+----------+-----------+----------+---------------+----------------+ +1 row in set (0.01 sec) +``` \ No newline at end of file diff --git a/docs/MatrixOne/Reference/SQL-Reference/SQL-Type.md b/docs/MatrixOne/Reference/SQL-Reference/SQL-Type.md index ece8653bb..cc8a7f3f3 100644 --- a/docs/MatrixOne/Reference/SQL-Reference/SQL-Type.md +++ b/docs/MatrixOne/Reference/SQL-Reference/SQL-Type.md @@ -98,6 +98,11 @@ Data Query Language (DQL) is used to retrieve existing data in MatrixOne. It pri - [SUBQUERY with EXISTS](Data-Query-Language/subqueries/subquery-with-exists.md) - [SUBQUERY with IN](Data-Query-Language/subqueries/subquery-with-in.md) +### Apply Query - A query that applies an operation to each row of data + +- [CROSS APPLY](Data-Query-Language/apply/cross-apply.md) +- [OUTER APPLY](Data-Query-Language/apply/outer-apply.md) + ### Join Query - Combining Results from Multiple Tables - [INNER JOIN](Data-Query-Language/join/inner-join.md) diff --git a/docs/MatrixOne/Reference/Variable/system-variables/illegal_login_restrictions.md b/docs/MatrixOne/Reference/Variable/system-variables/illegal_login_restrictions.md new file mode 100644 index 000000000..35975b658 --- /dev/null +++ b/docs/MatrixOne/Reference/Variable/system-variables/illegal_login_restrictions.md @@ -0,0 +1,263 @@ +# Illegal login restrictions + +Today, when data security is increasingly important, reasonable connection control and password management strategies are the key to database protection. MatrixOne provides a series of global parameters designed to enhance connection security and password management to prevent malicious attacks and unauthorized access. + +- Connection control parameters + - `connection_control_failed_connections_threshold`: This parameter sets the maximum number of failed connections allowed in a short period of time. When the threshold is exceeded, MatrixOne will reject further connection attempts from the client, effectively preventing brute force and malicious attacks. + - `connection_control_max_connection_delay`: This parameter specifies the maximum delay time that the client needs to wait after the connection fails. This delay will be applied after the number of failed connections reaches a threshold to prevent further connection attempts and increase the cost of malicious attacks. + +- Password management parameters + - `default_password_lifetime`: This parameter specifies the validity period of the user password in days. The default value is 0, which means the password will never expire. When the password expires, the user can still log in to the database, but cannot perform SQL operations unless the password is changed through `ALTER USER`. + - `password_history`: This parameter restricts users from using recent password history when changing passwords. If set to 5, the user will not be able to reuse the last 5 passwords. This configuration can effectively avoid security risks caused by password reuse. + - `password_reuse_interval`: This parameter controls the user's ability to reuse historical passwords within a specified time range after the password expires. The unit is days, and the default value is 0, which means no reuse check of historical passwords is performed. + +## Check + +```sql +SELECT @@global.connection_control_failed_connections_threshold; --Default value is 3 +SELECT @@global.connection_control_max_connection_delay; --Default value is 0 +SELECT @@global.default_password_lifetime; --Default value is 0 +SELECT @@global.password_history; --Default value is 0 +SELECT @@global.password_reuse_interval; --Default value is 0 +``` + +## set up + +After setting, you need to exit and reconnect to take effect. + +```sql +set global connection_control_failed_connections_threshold=xx; +set global connection_control_max_connection_delay=xx;--Unit: ms +set global default_password_lifetime=xx;--unit is days +set global password_history=xx; +set global password_reuse_interval=xx;--unit is days +``` + +## Example + +### connection_control_failed_connections_threshold & connection_control_max_connection_delay + +```sql +mysql> SELECT @@global.connection_control_failed_connections_threshold; ++---------------------------------------------------+ +| @@connection_control_failed_connections_threshold | ++---------------------------------------------------+ +| 3 | ++---------------------------------------------------+ +1 row in set (0.00 sec) + +mysql> SELECT @@global.connection_control_max_connection_delay; ++-------------------------------------------+ +| @@connection_control_max_connection_delay | ++-------------------------------------------+ +| 0 | ++-------------------------------------------+ +1 row in set (0.00 sec) + +set global connection_control_failed_connections_threshold=2; +set global connection_control_max_connection_delay=10000; + +--exit,Log out and reconnect +mysql> SELECT @@global.connection_control_failed_connections_threshold; ++---------------------------------------------------+ +| @@connection_control_failed_connections_threshold | ++---------------------------------------------------+ +| 2 | ++---------------------------------------------------+ +1 row in set (0.00 sec) + +mysql> SELECT @@global.connection_control_max_connection_delay; ++-------------------------------------------+ +| @@connection_control_max_connection_delay | ++-------------------------------------------+ +| 10000 | ++-------------------------------------------+ +1 row in set (0.00 sec) + +--Create a normal user and grant permissions +create user user1 identified by '111'; +create role role1; +grant create database on account * to role1; +grant alter user on account * to role1; +grant role1 to user1; +``` + +Trying to log in user1 with wrong password + +```bash +#First time: logging in with wrong password +(base) admin@admindeMacBook-Pro matrixorigin.io.cn % mysql -u user1 -h 127.0.0.1 -P 6001 -p123 +mysql: [Warning] Using a password on the command line interface can be insecure. +ERROR 1045 (28000): Access denied for user user1. internal error: check password failed + +#Second time: Log in with wrong password +(base) admin@admindeMacBook-Pro matrixorigin.io.cn % mysql -u user1 -h 127.0.0.1 -P 6001 -p123 +mysql: [Warning] Using a password on the command line interface can be insecure. +ERROR 1045 (28000): Access denied for user user1. internal error: check password failed + +#Third time: Log in with the correct password +(base) admin@admindeMacBook-Pro matrixorigin.io.cn % mysql -u user1 -h 127.0.0.1 -P 6001 -p111 +mysql: [Warning] Using a password on the command line interface can be insecure. +ERROR 20101 (HY000): internal error: user is locked, please try again later + +#Wait about ten seconds and log in again. The login is successful. +(base) admin@admindeMacBook-Pro matrixorigin.io.cn % mysql -u user1 -h 127.0.0.1 -P 6001 -p111 +mysql: [Warning] Using a password on the command line interface can be insecure. +Welcome to the MySQL monitor. Commands end with ; or \g. +Your MySQL connection id is 2662 +Server version: 8.0.30-MatrixOne-v MatrixOne + +Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. + +Oracle is a registered trademark of Oracle Corporation and/or its +affiliates. Other names may be trademarks of their respective +owners. + +Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. + +mysql> + +``` + +### default_password_lifetime + +```sql +mysql> SELECT @@global.default_password_lifetime; ++-----------------------------+ +| @@default_password_lifetime | ++-----------------------------+ +| 0 | ++-----------------------------+ +1 row in set (0.00 sec) + +set global default_password_lifetime=1; + +mysql> SELECT @@global.default_password_lifetime; --Effective after reconnection ++-----------------------------+ +| @@default_password_lifetime | ++-----------------------------+ +| 1 | ++-----------------------------+ +1 row in set (0.00 sec) +``` + +Stop mo and modify the system time to 1 month later + +```bash +# stop mo +>mo_ctl stop + +# Modify the system time to 1 month later +> sudo date "122518302024" +Wed Dec 25 18:30:00 CST 2024 + +#View modified time +> date +Wed Dec 25 18:30:02 CST 2024 + +#Start mo +>mo_ctl start + +#Root user connects to mo and confirms the current time +>mo_ctl connect + +mysql> select current_timestamp; ++----------------------------+ +| current_timestamp() | ++----------------------------+ +| 2024-12-25 18:32:30.664877 | ++----------------------------+ +1 row in set (0.00 sec) + +#Try to log in as a normal user. You are expected to be able to log in, but you cannot execute SQL statements other than alter user xxx identified by 'xxxx';; the dump user is not subject to this restriction. +>mysql -u sys:user1:role1 -h 127.0.0.1 -P 6001 -p123 + +mysql> create database db1; +ERROR 20101 (HY000): internal error: password has expired, please change the password +mysql> alter user user1 identified by '123'; +Query OK, 0 rows affected (0.01 sec) + +#Log in with changed password +>mysql -u sys:user1:role1 -h 127.0.0.1 -P 6001 -p123 + +mysql> create database db1; +Query OK, 1 row affected (0.03 sec) +``` + +### password_history + +```sql +mysql> SELECT @@global.password_history; ++--------------------+ +| @@password_history | ++--------------------+ +| 0 | ++--------------------+ +1 row in set (0.00 sec) + +set global password_history=2; + +mysql> SELECT @@global.password_history; ++--------------------+ +| @@password_history | ++--------------------+ +| 2 | ++--------------------+ +1 row in set (0.01 sec) + +mysql> create user user2 identified by '111'; +Query OK, 0 rows affected (0.03 sec) +--Change password to '123', successful +mysql> alter user user2 identified by '123'; +Query OK, 0 rows affected (0.02 sec) + +--Changing the password to 111 failed because password_history=2 and MatrixOne will retain the history of the last 2 passwords. +mysql> alter user user2 identified by '111'; +ERROR 20301 (HY000): invalid input: The password has been used before, please change another one. + +--Change password to '123', successful +mysql> alter user user2 identified by '234'; +Query OK, 0 rows affected (0.02 sec) + +--Change the password again to '111', successful +mysql> alter user user2 identified by '111'; +Query OK, 0 rows affected (0.01 sec) +``` + +### password_reuse_interval + +```sql +mysql> select @@global.password_reuse_interval; ++---------------------------+ +| @@password_reuse_interval | ++---------------------------+ +| 0 | ++---------------------------+ +1 row in set (0.00 sec) + +mysql> set global password_reuse_interval=30; +Query OK, 0 rows affected (0.00 sec) + +mysql> select @@global.password_reuse_interval; --Effective after reconnection ++---------------------------+ +| @@password_reuse_interval | ++---------------------------+ +| 30 | ++---------------------------+ +1 row in set (0.02 sec) + +--Create user user3 +create user user3 identified by '111'; + +--Modify user password, successful +mysql> alter user user3 identified by '123'; +Query OK, 0 rows affected (0.02 sec) + +--After changing the system time to ten days and then restarting mo, I changed the user3 password to '111', which failed. +mysql> alter user user3 identified by '111'; +ERROR 20301 (HY000): invalid input: The password has been used before, please change another one + +--After changing the system time to two months, restart mo and change user3 password to '111', successful +mysql> alter user user3 identified by '111'; +Query OK, 0 rows affected (0.01 sec) +``` \ No newline at end of file diff --git a/docs/MatrixOne/Reference/Variable/system-variables/password_complex.md b/docs/MatrixOne/Reference/Variable/system-variables/password_complex.md new file mode 100644 index 000000000..5d423594e --- /dev/null +++ b/docs/MatrixOne/Reference/Variable/system-variables/password_complex.md @@ -0,0 +1,296 @@ +# Password complexity check + +MatrixOne provides a series of system variables for configuring password complexity verification to ensure password security. These variables support dynamic modification. The core variable is validate_password. The other settings only take effect when validate_password is turned on. + +- validate_password: Switch to control the password complexity verification function, value range: ON | OFF (default value: OFF). + +- validate_password.changed_characters_percentage: Specifies the proportion of characters that need to be changed in the new password compared to the old password, value range: [0-100] (default value: 0). + +- Password policy (validate_password.policy): used to define the global password complexity policy, supporting two modes: 0/low and 1/medium: + + + + + + + + + + + + + + + + + + + + + + + +
PolicyEffective parameters
0/LOwvalidate_password.length
1/MEDIUMvalidate_password.length
validate_password.mixed_case_count
validate_password.number_count
validate_password.special_char_count
+ + - validate_password.length: Specifies the minimum character length of the password, value range: >= 0 (default value: 8). + + - validate_password.mixed_case_count: The minimum number of uppercase and lowercase characters required in the password, value range: >= 0 (default value: 1). + + - validate_password.number_count: Specifies the minimum number of numeric characters that must be included in the password, value range: >= 0 (default value: 1). + + - validate_password.special_char_count: Specifies the minimum number of special characters that need to be included in the password, value range: >= 0 (default value: 1). + +## Check + +```sql +select @@global.validate_password; +select @@global.validate_password.changed_characters_percentage; +select @@global.validate_password.check_user_name; +select @@global.validate_password.length; +select @@global.validate_password.mixed_case_count; +select @@global.validate_password.number_count; +select @@global.validate_password.special_char_count; +``` + +## set up + +After setting, you need to exit and reconnect to take effect. + +```sql +set global validate_password=xx; --Default is 0 +set global validate_password.changed_characters_percentage=xx; --Default is 0 +set global validate_password.check_user_name=xx;--Default is 1 +set global validate_password.policy=xx;--Default is 0 +set global validate_password.length=xx;--Default is 8 +set global validate_password.mixed_case_count=xx;--Default is 1 +set global validate_password.number_count=xx;--Default is 1 +set global validate_password.special_char_count==xx;--Default is 1 +``` + +## Example + +### validate_password + +```sql +mysql> select @@global.validate_password; ++---------------------+ +| @@validate_password | ++---------------------+ +| 0 | ++---------------------+ +1 row in set (0.00 sec) + +mysql> set global validate_password=1; +Query OK, 0 rows affected (0.02 sec) + +mysql> select @@global.validate_password; --Reconnection takes effect ++---------------------+ +| @@validate_password | ++---------------------+ +| 1 | ++---------------------+ +1 row in set (0.00 sec) + +``` + +### validate_password.changed_characters_percentage + +```sql +mysql> select @@global.validate_password.changed_characters_percentage; ++---------------------------------------------------+ +| @@validate_password.changed_characters_percentage | ++---------------------------------------------------+ +| 0 | ++---------------------------------------------------+ +1 row in set (0.01 sec) + +# Create user u1, character ratio is 0%, created successfully +mysql> create user u1 identified by '12345678'; +Query OK, 0 rows affected (0.02 sec) + +mysql>set global validate_password.changed_characters_percentage=80;--Set character proportion to 80% + +mysql> select @@global.validate_password.changed_characters_percentage; --Reconnection takes effect ++---------------------------------------------------+ +| @@validate_password.changed_characters_percentage | ++---------------------------------------------------+ +| 80 | ++---------------------------------------------------+ +1 row in set (0.00 sec) + +# Create user u2, character ratio is 0%, creation failed +mysql> create user u2 identified by '12345678'; +ERROR 20301 (HY000): invalid input: Password '12345678' does not contain enough changed characters + +# Create user u2, characters account for 20%, creation failed +mysql> create user u2 identified by '12345678ab'; +ERROR 20301 (HY000): invalid input: Password '12345678ab' does not contain enough changed characters + +# Create user u2, characters account for 80%, created successfully +mysql> create user u4 identified by '12abdefhij'; +Query OK, 0 rows affected (0.01 sec) +``` + +### validate_password.policy and its related parameters + +The following parameters need to enable validate_password.policy to take effect. + +```sql +mysql> select @@global.validate_password.policy; ++----------------------------+ +| @@validate_password.policy | ++----------------------------+ +| 0 | ++----------------------------+ +1 row in set (0.00 sec) +set global validate_password.policy=1; + +mysql> select @@global.validate_password.policy;--Reconnection takes effect ++----------------------------+ +| @@validate_password.policy | ++----------------------------+ +| 1 | ++----------------------------+ +1 row in set (0.00 sec) +``` + +#### validate_password.length + +```sql +mysql> select @@global.validate_password.length; ++----------------------------+ +| @@validate_password.length | ++----------------------------+ +| 8 | ++----------------------------+ +1 row in set (0.00 sec) + +# Create user u3, the password length is 8, the creation is successful +mysql> create user u3 identified by 'Pass123!'; +Query OK, 0 rows affected (0.01 sec) + +mysql> set global validate_password.length=9; +Query OK, 0 rows affected (0.01 sec) + +mysql> select @@global.validate_password.length; ++----------------------------+ +| @@validate_password.length | ++----------------------------+ +| 9 | ++----------------------------+ +1 row in set (0.00 sec) + +# Create user u4, password length is 8, creation failed +mysql> create user u4 identified by 'Pass123!'; +ERROR 20301 (HY000): invalid input: Password 'Pass123!' is too short, require at least 9 characters + +# Create user u4, the password length is 9, the creation is successful +mysql> create user u4 identified by 'Pass1234!'; +Query OK, 0 rows affected (0.02 sec) +``` + +#### validate_password.mixed_case_count + +```sql +mysql> select @@global.validate_password.mixed_case_count; ++--------------------------------------+ +| @@validate_password.mixed_case_count | ++--------------------------------------+ +| 1 | ++--------------------------------------+ +1 row in set (0.00 sec) + +--Create user u4, the password contains one uppercase letter and one lowercase letter, the creation is successful +mysql> create user u4 identified by 'Pa12345!'; +Query OK, 0 rows affected (0.01 sec) + +--Set validate_password.mixed_case_count to 2 +mysql> set global validate_password.mixed_case_count=2; +Query OK, 0 rows affected (0.01 sec) + +mysql> select @@global.validate_password.mixed_case_count; --Reconnection takes effect ++--------------------------------------+ +| @@validate_password.mixed_case_count | ++--------------------------------------+ +| 2 | ++--------------------------------------+ +1 row in set (0.00 sec) + +--Create user u5. The password contains one uppercase letter and one lowercase letter. The creation failed. +mysql> create user u5 identified by 'Pa12345!'; +ERROR 20301 (HY000): invalid input: Password 'Pa12345!' does not meet the Lowercase requirements + +--Create user u5. The password contains two uppercase letters and two lowercase letters. The creation failed. +mysql> create user u5 identified by 'PPaa123!'; +Query OK, 0 rows affected (0.01 sec) +``` + +#### validate_password.number_count + +```sql +mysql> select @@global.validate_password.number_count; ++----------------------------------+ +| @@validate_password.number_count | ++----------------------------------+ +| 1 | ++----------------------------------+ +1 row in set (0.00 sec) + +--Create user u6, the password contains 1 number, the creation is successful +mysql> create user u6 identified by 'Password1!'; +Query OK, 0 rows affected (0.01 sec) + +mysql> set global validate_password.number_count=2; +Query OK, 0 rows affected (0.01 sec) + +mysql> select @@global.validate_password.number_count; ++----------------------------------+ +| @@validate_password.number_count | ++----------------------------------+ +| 2 | ++----------------------------------+ +1 row in set (0.00 sec) + +--Create user u7, the password contains a number, the creation failed +mysql> create user u7 identified by 'Password1!'; +ERROR 20301 (HY000): invalid input: Password 'Password1!' does not meet the Number requirements + +--Create user u7, the password contains two numbers, the creation is successful +mysql> create user u7 identified by 'Password12!'; +Query OK, 0 rows affected (0.01 sec) +``` + +#### validate_password.special_char_count + +```sql +mysql> select @@global.validate_password.special_char_count; ++----------------------------------------+ +| @@validate_password.special_char_count | ++----------------------------------------+ +| 1 | ++----------------------------------------+ +1 row in set (0.00 sec) + +--Create user u8, the password contains a special character, the creation is successful +mysql> create user u8 identified by 'Password123!'; +Query OK, 0 rows affected (0.01 sec) + +mysql> set global validate_password.special_char_count=2; +Query OK, 0 rows affected (0.01 sec) + +mysql> select @@global.validate_password.special_char_count; --Effective after reconnection ++----------------------------------------+ +| @@validate_password.special_char_count | ++----------------------------------------+ +| 2 | ++----------------------------------------+ +1 row in set (0.00 sec) + +--Create user u9. The password contains a special character and the creation fails. +mysql> create user u9 identified by 'Password123!'; +ERROR 20301 (HY000): invalid input: Password 'Password123!' does not meet the Special Char requirements + +--Create user u9, the password contains two special characters, the creation is successful +mysql> create user u9 identified by 'Password123!!'; +Query OK, 0 rows affected (0.01 sec) +``` \ No newline at end of file diff --git a/docs/MatrixOne/Reference/Variable/system-variables/whitelist.md b/docs/MatrixOne/Reference/Variable/system-variables/whitelist.md new file mode 100644 index 000000000..fca9f5819 --- /dev/null +++ b/docs/MatrixOne/Reference/Variable/system-variables/whitelist.md @@ -0,0 +1,83 @@ +# Connection whitelist + +MatrixOne supports the following variables for restricting only clients with specific IP addresses from connecting to the database: + +1. **`validnode_checking`**: Control whether to enable the IP whitelist function. The value range of this variable is `ON` or `OFF`, and the default value is `OFF`. + +2. **`invited_nodes`**: Define the list of IP addresses allowed to connect to the MO database. The following formats are supported: + - **Single IP address**: e.g. `(192.168.1.100, 192.168.1.101)` + - **Wildcard**: `(*)` means allow all IP addresses to connect + - **CIDR format**: For example `(192.168.1.100, 192.168.1.0/8, 192.168.0.0/32)` + + The default value of this variable is `*`, which means that all clients can connect by default. + +The above configuration provides a flexible access control mechanism for the database to meet a variety of network security needs. + +## Check + +```sql +select @@global.validnode_checking; +select @@global.invited_nodes; +``` + +## set up + +```sql +set global validnode_checking=xx;--Default is 0 +set global invited_nodes=xx; --Default is * +``` + +## Example + +```sql +mysql> select @@global.validnode_checking; ++----------------------+ +| @@validnode_checking | ++----------------------+ +| 0 | ++----------------------+ +1 row in set (0.00 sec) + +mysql> select @@global.invited_nodes; ++-----------------+ +| @@invited_nodes | ++-----------------+ +| * | ++-----------------+ +1 row in set (0.00 sec) + +mysql> set global validnode_checking=1; +Query OK, 0 rows affected (0.02 sec) +set global invited_nodes='10.222.2.36'; + +--View IP +root@host-10-222-4-5:~# hostname -I +10.222.4.5 + +--Connect to 10.222.2.36 from the machine with ip 10.222.4.5 +root@host-10-222-4-5:~# mysql -uroot -P 6001 -h10.222.2.36 -p111 +mysql: [Warning] Using a password on the command line interface can be insecure. +Welcome to the MySQL monitor. Commands end with ; or \g. +Your MySQL connection id is 62 +Server version: 8.0.30-MatrixOne-v MatrixOne + +Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. + +Oracle is a registered trademark of Oracle Corporation and/or its +affiliates. Other names may be trademarks of their respective +owners. + +Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. + +mysql> + + +--View IP +root@host-10-222-4-8:~# hostname -I +10.222.4.8 + +--Connect to 10.222.2.36 from the machine with IP address 10.222.4.8. The connection fails because it is not in the whitelist. +root@host-10-222-4-8:~# mysql -uroot -P 6001 -h10.222.2.36 -p111 +mysql: [Warning] Using a password on the command line interface can be insecure. +ERROR 20301 (HY000): invalid input: IP 10.222.4.8 is not in the invited nodes +``` diff --git a/docs/MatrixOne/Reference/mo-tools/mo_ctl_standalone.md b/docs/MatrixOne/Reference/mo-tools/mo_ctl_standalone.md index 67e2d1fb7..22ebffe56 100644 --- a/docs/MatrixOne/Reference/mo-tools/mo_ctl_standalone.md +++ b/docs/MatrixOne/Reference/mo-tools/mo_ctl_standalone.md @@ -150,12 +150,12 @@ mo_ctl deploy help Usage : mo_ctl deploy [mo_version] [force] # deploy mo onto the path configured [mo_version]: optional, specify an mo version to deploy [force] : optional, if specified will delete all content under MO_PATH and deploy from beginning - e.g. : mo_ctl deploy # default, same as mo_ctl deploy 2.0.0 + e.g. : mo_ctl deploy # default, same as mo_ctl deploy 2.0.1 : mo_ctl deploy main # deploy development latest version : mo_ctl deploy d29764a # deploy development version d29764a - : mo_ctl deploy 2.0.0 # deploy stable verson 2.0.0 - : mo_ctl deploy force # delete all under MO_PATH and deploy verson 2.0.0 - : mo_ctl deploy 2.0.0 force # delete all under MO_PATH and deploy stable verson 2.0.0 from beginning + : mo_ctl deploy 2.0.1 # deploy stable verson 2.0.1 + : mo_ctl deploy force # delete all under MO_PATH and deploy verson 2.0.1 + : mo_ctl deploy 2.0.1 force # delete all under MO_PATH and deploy stable verson 2.0.1 from beginning ``` ### start - Starts the MatrixOne service @@ -295,7 +295,7 @@ Using `mo_ctl get_conf` will print a list of all parameters used by the current | GCC_VERSION | The version of gcc that precheck checks |default 8.5.0 | | GO_VERSION | The go version of the precheck check |default 1.22.3 | | MO_GIT_URL | MatrixOne source code pulling address | default | -| MO_DEFAULT_VERSION | The version of MatrixOne that is pulled by default | default 2.0.0 | +| MO_DEFAULT_VERSION | The version of MatrixOne that is pulled by default | default 2.0.1 | | GOPROXY | GOPROXY address, generally used for domestic accelerated pull golang dependencies | default ,direct | | STOP_INTERVAL | Stop interval, wait time to detect service status after stopping service | default 5 seconds | | START_INTERVAL | Startup interval, wait time to detect service status after starting the service | default 2 seconds | @@ -348,11 +348,11 @@ MatrixOne 0.8 and later can use `mo_ctl upgrade version` or `mo_ctl upgrade comm ``` mo_ctl upgrade help Usage : mo_ctl upgrade [version_commitid] # upgrade or downgrade mo from current version to a target commit id or stable version - [commitid] : a commit id such as '38888f7', or a stable version such as '2.0.0' + [commitid] : a commit id such as '38888f7', or a stable version such as '2.0.1' : use 'latest' to upgrade to latest commit on main branch if you don't know the id e.g. : mo_ctl upgrade 38888f7 # upgrade/downgrade to commit id 38888f7 on main branch : mo_ctl upgrade latest # upgrade/downgrade to latest commit on main branch - : mo_ctl upgrade 2.0.0 # upgrade/downgrade to stable version 2.0.0 + : mo_ctl upgrade 2.0.1 # upgrade/downgrade to stable version 2.0.1 ``` ### watchdog - Keep MatrixOne alive diff --git a/docs/MatrixOne/Release-Notes/release-timeline.md b/docs/MatrixOne/Release-Notes/release-timeline.md index 7a844cbcf..807219b93 100644 --- a/docs/MatrixOne/Release-Notes/release-timeline.md +++ b/docs/MatrixOne/Release-Notes/release-timeline.md @@ -4,6 +4,7 @@ This document shows all the released MatrixOne versions in reverse chronological | **Version** | **Release Date** | | :-------------------------- | :--------------- | +| [v24.2.0.1](v24.2.0.1.md) | 2024/12/10 | | [v24.2.0.0](v24.2.0.0.md) | 2024/11/01 | | [v24.1.2.4](v24.1.2.4.md) | 2024/09/23 | | [v24.1.2.3](v24.1.2.3.md) | 2024/09/11 | diff --git a/docs/MatrixOne/Release-Notes/v24.2.0.1.md b/docs/MatrixOne/Release-Notes/v24.2.0.1.md new file mode 100644 index 000000000..420c89f7d --- /dev/null +++ b/docs/MatrixOne/Release-Notes/v24.2.0.1.md @@ -0,0 +1,49 @@ +# **MatrixOne v24.2.0.1 Release Notes** + +Release Date: December 10, 2024 +MatrixOne Version: v24.2.0.1 + +MatrixOne 2.0.1 introduces a series of improvements and bug fixes that enhance system performance, stability, and usability. Below are the major updates and new features. + +## Improvements + +- Index and Query Optimization +- Memory and Resource Optimization +- Password Management +- Backup and Restore Enhancements +- Experimental support for full text search + +## Bug Fixes + +This release addresses several critical bugs that improve the overall stability and reliability of the system. Some of the key bug fixes include: + +- Transaction Management: + - Fixed deadlocks and transaction state inconsistencies in distributed environments. + - Resolved race conditions in transaction handling and session management. + - Improved error handling for lock conflicts and concurrent delete operations. + +- SQL Execution: + - Fixed issues with recursive CTEs, view creation, and ON DUPLICATE KEY UPDATE statements. + - Resolved problems with incorrect row counts and handling of compressed files during LOAD DATA. + +- Logtail and Cache: + - Addressed data race conditions and performance issues in logtail processing. + - Fixed issues with cache usage and hit status monitoring. + +- Full-Text Index: + - Fixed panics related to full-text index creation and runtime filters. + - Improved delete operations for tables with full-text indexes. + +- Backup and Restore: + - Fixed missing workspace data during the restore process. + - Resolved errors when restoring tables or databases with special keywords or case-sensitive names. + +- Performance and Stability: + - Addressed memory allocation issues in batch processing and deduplication operations. + - Resolved panics and race conditions in various modules, including query execution and system diagnostics. + +For additional bug fixes, please refer to the [MatrixOne-v24.2.0.1](https://github.com/matrixorigin/matrixone/releases/tag/v2.0.1) for more details. + +## Full Changelog + +[v24.2.0.0-v24.2.0.1](https://github.com/matrixorigin/matrixone/compare/v2.0.0...v2.0.1) \ No newline at end of file diff --git a/docs/MatrixOne/Security/TLS-introduction.md b/docs/MatrixOne/Security/TLS-introduction.md index 591228077..08d687cf4 100644 --- a/docs/MatrixOne/Security/TLS-introduction.md +++ b/docs/MatrixOne/Security/TLS-introduction.md @@ -109,7 +109,7 @@ After completing the configuration of these two main steps, a TLS secure connect Current pager: stdout Using outfile: '' Using delimiter: ; - Server version: 8.0.30-MatrixOne-v2.0.0 MatrixOne + Server version: 8.0.30-MatrixOne-v2.0.1 MatrixOne Protocol version: 10 Connection: 127.0.0.1 via TCP/IP Server characterset: utf8mb4 @@ -134,7 +134,7 @@ After completing the configuration of these two main steps, a TLS secure connect Current pager: stdout Using outfile: '' Using delimiter: ; - Server version: 8.0.30-MatrixOne-v2.0.0 MatrixOne + Server version: 8.0.30-MatrixOne-v2.0.1 MatrixOne Protocol version: 10 Connection: 127.0.0.1 via TCP/IP Server characterset: utf8mb4 diff --git a/docs/MatrixOne/Tutorial/django-python-crud-demo.md b/docs/MatrixOne/Tutorial/django-python-crud-demo.md index 7ea56fe6d..30da739c7 100644 --- a/docs/MatrixOne/Tutorial/django-python-crud-demo.md +++ b/docs/MatrixOne/Tutorial/django-python-crud-demo.md @@ -183,7 +183,7 @@ mysql> show tables; ## Insert Data -- Adding data requires the creation of objects first, and then through the ORM-supplied objects-supplied method create . Create a new views.py file in the django\_crud\_matrixone directory under the previously created django\_crud\_matrixone directory and enter the code: +- Adding data requires the creation of objects first, and then through the ORM-supplied objects-supplied method create . Create a new views.py file in the django\_crud\_matrixone directory under the previously created django_crud_matrixone directory and enter the code: ``` from django.shortcuts import render,HttpResponse diff --git a/docs/MatrixOne/Tutorial/htap-demo.md b/docs/MatrixOne/Tutorial/htap-demo.md new file mode 100644 index 000000000..c318acf54 --- /dev/null +++ b/docs/MatrixOne/Tutorial/htap-demo.md @@ -0,0 +1,232 @@ +# HTAP + +With the growth of enterprise scale and the explosive increase in data volume, traditional transactional databases are beginning to be stretched when dealing with advanced applications such as data analysis, and cannot meet the multi-dimensional needs of enterprises for data analysis. The proliferation of business systems and the increasing complexity of business logic have forced many companies to split their databases. However, this split architecture is difficult to implement complex correlation statistics and real-time analysis across shards due to the physical isolation between instances, which greatly limits the application potential of the database. To address these challenges, real-time data warehouse technology emerged. However, although real-time data warehouses provide solutions, the complexity and high cost of their architecture require enterprises to invest a lot of human resources in maintaining and building complex data synchronization links, which is not necessary in many cases. +MatrixOne's HTAP Mixed Workload Engine provides a breakthrough solution. It seamlessly integrates online transaction processing and real-time data analysis capabilities through a single database core, thereby eliminating the need for data synchronization in traditional architectures. This integrated architecture design not only greatly simplifies the technical architecture and improves the efficiency of business processing, but also injects new vitality into the company's continuous innovation and efficiency improvement. The implementation of MatrixOne HTAP enables enterprises to respond to the dual challenges of data analysis and transaction processing more agilely, achieving instant analysis of data and rapid decision-making, while avoiding additional maintenance costs and technical complexity. + +## What is HTAP? + +HTAP, or Hybrid Transactional/Analytical Processing, is a database architecture that can handle both transactional (OLTP) and analytical (OLAP) workloads within a single database system. The advantage of this architecture is that it can reduce data storage redundancy, improve query performance, and support real-time data analysis to help enterprises make quick decisions. + +
+ +
+ +## Application scenarios + +The application scenarios of HTAP database are mainly concentrated in business environments that need to handle high concurrent transactions and complex analysis queries at the same time. The following are some specific application scenarios: + +1. **Real-time risk control and anti-fraud in the financial industry**: The financial industry has an urgent need for real-time monitoring and analysis of transaction data. The HTAP database can realize the synchronization of transactions and risk analysis, helping financial institutions to detect and block fraud in a timely manner. behavior to reduce losses. + +2. **Real-time data processing in IoT systems**: The amount of data generated by IoT devices is huge, and the HTAP database can process and analyze these data in real time to provide support for intelligent decision-making, such as in industrial automation and smart city construction. + +3. **Data service platform or data middle platform**: HTAP database can be used as the underlying support of the data service platform, providing unified data views and real-time data analysis capabilities, supporting the data needs of different departments within the enterprise, and promoting data sharing and business Innovation. +4. **Network management and optimization in the telecommunications industry**: Telecom operators can use the HTAP database to monitor network status in real time, analyze user behavior patterns, optimize network resource allocation, and improve network service quality. + +5. **Real-time analysis in enterprise resource planning (ERP) systems**: In ERP systems, HTAP databases can provide real-time business insights and decision support, helping companies quickly respond to market changes and optimize resource allocation. + +Through its row-column coexistence storage architecture, the HTAP database effectively combines the advantages of OLTP and OLAP, supports real-time transaction processing and complex data analysis, and meets the needs of modern enterprises for data real-time, consistency and analysis capabilities. With the development of technology and the deepening of application, HTAP database will play an important role in more fields. + +## Preparation before starting + +### Environment configuration + +Before you begin, make sure you have downloaded and installed the following software: + +- Confirm that you have completed [Stand-alone Deployment of MatrixOne](../Get-Started/install-standalone-matrixone.md). + +- Make sure you have installed [Python 3.8(or plus)](https://www.python.org/downloads/). +Use the following code to check the Python version to confirm the installation was successful: + + ``` + #To check with Python installation and its version + python3 -V + ``` + +- Confirm that you have completed installing the MySQL client. + +## Application cases + +We create a real-time risk control and anti-fraud application example in the financial industry based on **Scenario 1**, mainly by simulating concurrent transactions and regularly checking whether the total transaction amount of any user exceeds their account balance within 24 hours. The system will report these risky transactions. + +### Create table + +Prepare a user table and transaction table + +```sql +drop table transactions; +drop table users; + +CREATE TABLE IF NOT EXISTS Users ( + user_id INT AUTO_INCREMENT PRIMARY KEY, --user id + username VARCHAR(255) NOT NULL, --username + account_balance DECIMAL(10, 2) NOT NULL --account balance +); +CREATE TABLE IF NOT EXISTS Transactions ( + transaction_id INT AUTO_INCREMENT PRIMARY KEY, --transaction id + user_id INT NOT NULL, --user id + amount DECIMAL(10, 2) NOT NULL, --transaction amount + transaction_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP, --transaction time + FOREIGN KEY (user_id) REFERENCES Users(user_id) +); +``` + +### Create database connection pool + +```python +import mysql.connector + +def create_connection_pool(max_connections=10): + return mysql.connector.pooling.MySQLConnectionPool( +pool_name="my_connection_pool", + pool_size=max_connections, + host='127.0.0.1', + database = 'test', + user = 'root', + password = '111', + port = 6001, + autocommit=True + ) +``` + +### Prepare user information data + +Here, we will programmatically generate 100 pieces of random user account data. + +```python +import random + +def insert_users(pool): + conn = pool.get_connection() + try: + cursor = conn.cursor() + for _ in range(100): # Suppose we want to insert 100 users + username = f'user{_}' +account_balance = round(random.uniform(100, 10000), 2) + sql = "INSERT INTO Users (username, account_balance) VALUES (%s, %s)" + cursor.execute(sql, (username, account_balance)) + except Exception as e: + print(e) +``` + +### Prepare transaction information data + +Transaction information is randomly generated through the program. + +```python +import secrets + +def insert_transactions(pool): + conn = pool.get_connection() + try: + cursor = conn.cursor() + for _ in range(10): # Assume we want to insert 10 pieces of data +user_id = random.randint(1, 100) # Assume user ID from 1 to 100 + amount = round(secrets.randbelow(1000 *100) /100, 2) + sql = """ + INSERT INTO Transactions (user_id, amount) + VALUES (%s, %s) + """ + cursor.execute(sql, (user_id, amount)) + except Exception as e: + print(e) +``` + +### Define risk control analysis rules + +We define risk control rules as: summarizing all transactions of each user within a day and calculating the total transaction amount. If it is found that the cumulative transaction amount of a user on the same day exceeds the current balance in his account, the system will automatically mark the user as a suspicious user, thus triggering a risk warning. + +```python +def analyze_transactions(pool): + try: + conn = pool.get_connection() + cursor = conn.cursor() + sql = """ + SELECT + t.user_id, + SUM(t.amount) AS total_transaction_amount, + t.transaction_time, + u.account_balance + FROM + Transactions t + JOIN + Users u ON t.user_id = u.user_id + WHERE +t.transaction_time > DATE_SUB(NOW(), INTERVAL 1 DAY) + GROUP BY + t.user_id, t.transaction_time,u.account_balance + HAVING + SUM(t.amount) > u.account_balance; + """ + cursor.execute(sql) + result = cursor.fetchall() + for row in result: + print("suspicious account id",row[0],"total transaction amount of the day",row[1],"transaction time",row[2],"account balance",row[3]) + except Exception as e: + print(e) +``` + +### Trading and Analysis + +Here, we created five threads to simulate a parallel processing trading environment. After each transaction operation is successfully completed, the system will automatically start the risk control analysis process. + +```python +import threading + +def thread_insert(): + #Create connection pool + pool = create_connection_pool() + if pool: + #Create multiple threads + threads = [] + for _ in range(5): # Create 5 threads + thread = threading.Thread(target=insert_transactions, args=(pool,)) + threads.append(thread) + thread.start() + for thread in threads: + thread.join() # Wait for all threads to complete + analyze_transactions(pool) +``` + +### Create a scheduled task + +By arranging scheduled tasks, the simulation generates a continuous stream of real-time transaction data. + +```python +import time +from apscheduler.schedulers.background import BackgroundScheduler + +def main(): + pool = create_connection_pool() + insert_users(pool) + while True: + #Create background scheduler + scheduler = BackgroundScheduler() + # Execute the data insertion task every minute and conduct risk control analysis + scheduler.add_job(thread_insert, 'interval', minutes=1) + # Start scheduler + scheduler.start() + # Prevent script from exiting + try: + while True: + time.sleep(2) +except (KeyboardInterrupt, SystemExit): + # Close the scheduler + scheduler.shutdown() +``` + +### View results + +```python +if __name__ == '__main__': + main() +``` + +Console output: + +```bash +Suspicious account id 56 Total transaction amount for the day 754.52 Transaction time 2024-07-12 15:57:33 Account balance 516.29 +Suspicious account id 82 Total transaction amount for the day 817.18 Transaction time 2024-07-12 15:57:33 Account balance 461.46 +Suspicious account id 40 Total transaction amount for the day 502.32 Transaction time 2024-07-12 15:57:33 Account balance 174.15 +Suspicious account id 82 Total transaction amount for the day 525.94 Transaction time 2024-07-12 15:57:33 Account balance 461.46 +... +``` \ No newline at end of file diff --git a/docs/MatrixOne/Tutorial/rag-demo.md b/docs/MatrixOne/Tutorial/rag-demo.md index ab633bd67..3a3ab1aa6 100644 --- a/docs/MatrixOne/Tutorial/rag-demo.md +++ b/docs/MatrixOne/Tutorial/rag-demo.md @@ -124,7 +124,7 @@ documents = [ "MatrixOne touts significant features, including real-time HTAP, multi-tenancy, stream computation, extreme scalability, cost-effectiveness, enterprise-grade availability, and extensive MySQL compatibility. MatrixOne unifies tasks traditionally performed by multiple databases into one system by offering a comprehensive ultra-hybrid data solution. This consolidation simplifies development and operations, minimizes data fragmentation, and boosts development agility.", "MatrixOne is optimally suited for scenarios requiring real-time data input, large data scales, frequent load fluctuations, and a mix of procedural and analytical business operations. It caters to use cases such as mobile internet apps, IoT data applications, real-time data warehouses, SaaS platforms, and more.", "Matrix is a collection of complex or real numbers arranged in a rectangular array.", -"The lastest version of MatrixOne is v24.2.0.0,released on 2024/11/01." +"The lastest version of MatrixOne is v24.2.0.1,released on 2024/12/10." "We are excited to announce MatrixOne v22.0.8.0 release on 2023/6/30." ] @@ -194,7 +194,7 @@ print(output['response']) Console output related answer: ``` -Based on the provided data, the latest version of MatrixOne is v24.2.0.0, which was released on 2024/11/01. +Based on the provided data, the latest version of MatrixOne is v24.2.0.1, which was released on 2024/12/10. ``` After enhancement, the model generates the correct answer. diff --git a/mkdocs.yml b/mkdocs.yml index 9d3a71e00..00fd903d1 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -173,6 +173,7 @@ nav: - Golang CRUD demo: MatrixOne/Tutorial/develop-golang-crud-demo.md - Gorm CRUD demo: MatrixOne/Tutorial/gorm-golang-crud-demo.md - C# CRUD demo: MatrixOne/Tutorial/c-net-crud-demo.md + - HTAP Application demo: MatrixOne/Tutorial/htap-demo.md - Rag Application demo: MatrixOne/Tutorial/rag-demo.md - Picture(Text)-to-Picture Search Application demo: MatrixOne/Tutorial/search-picture-demo.md - Ecological Tools: @@ -298,6 +299,9 @@ nav: - Lower case table names support: MatrixOne/Reference/Variable/system-variables/lower_case_tables_name.md - Foreign key checking support: MatrixOne/Reference/Variable/system-variables/foreign_key_checks.md - User-specified case consistency support for query result set column names: MatrixOne/Reference/Variable/system-variables/keep_user_target_list_in_result.md + - Illegal login restrictions: MatrixOne/Reference/Variable/system-variables/illegal_login_restrictions.md + - Password complexity verification: MatrixOne/Reference/Variable/system-variables/password_complex.md + - Connection whitelist: MatrixOne/Reference/Variable/system-variables/whitelist.md - Custom variable: MatrixOne/Reference/Variable/custom-variable.md - SQL Language Structure: - Keywords: MatrixOne/Reference/Language-Structure/keywords.md @@ -374,15 +378,9 @@ nav: - LAST_QUERY_ID(): MatrixOne/Reference/SQL-Reference/Data-Manipulation-Language/information-functions/last-query-id.md - LAST_INSERT_ID(): MatrixOne/Reference/SQL-Reference/Data-Manipulation-Language/information-functions/last-insert-id.md - Data Query Language: - - SELECT: MatrixOne/Reference/SQL-Reference/Data-Query-Language/select.md - - SUBQUERY: - - SUBQUERY Overview: MatrixOne/Reference/SQL-Reference/Data-Query-Language/subqueries/subquery.md - - Derived Tables: MatrixOne/Reference/SQL-Reference/Data-Query-Language/subqueries/derived-tables.md - - Comparisons Using Subqueries: MatrixOne/Reference/SQL-Reference/Data-Query-Language/subqueries/comparisons-using-subqueries.md - - SUBQUERY with ANY or SOME: MatrixOne/Reference/SQL-Reference/Data-Query-Language/subqueries/subquery-with-any-some.md - - SUBQUERY with ALL: MatrixOne/Reference/SQL-Reference/Data-Query-Language/subqueries/subquery-with-all.md - - SUBQUERY with EXISTS: MatrixOne/Reference/SQL-Reference/Data-Query-Language/subqueries/subquery-with-exists.md - - SUBQUERY with IN: MatrixOne/Reference/SQL-Reference/Data-Query-Language/subqueries/subquery-with-in.md + - APPLY: + - CROSS APPLY: MatrixOne/Reference/SQL-Reference/Data-Query-Language/apply/cross-apply.md + - OUTER APPLY: MatrixOne/Reference/SQL-Reference/Data-Query-Language/apply/outer-apply.md - JOIN: - JOIN Overview: MatrixOne/Reference/SQL-Reference/Data-Query-Language/join/join.md - CROSS JOIN: MatrixOne/Reference/SQL-Reference/Data-Query-Language/join/inner-join.md @@ -392,6 +390,15 @@ nav: - FULL JOIN: MatrixOne/Reference/SQL-Reference/Data-Query-Language/join/full-join.md - OUTER JOIN: MatrixOne/Reference/SQL-Reference/Data-Query-Language/join/outer-join.md - NATURAL JOIN: MatrixOne/Reference/SQL-Reference/Data-Query-Language/join/natural-join.md + - SELECT: MatrixOne/Reference/SQL-Reference/Data-Query-Language/select.md + - SUBQUERY: + - SUBQUERY Overview: MatrixOne/Reference/SQL-Reference/Data-Query-Language/subqueries/subquery.md + - Derived Tables: MatrixOne/Reference/SQL-Reference/Data-Query-Language/subqueries/derived-tables.md + - Comparisons Using Subqueries: MatrixOne/Reference/SQL-Reference/Data-Query-Language/subqueries/comparisons-using-subqueries.md + - SUBQUERY with ANY or SOME: MatrixOne/Reference/SQL-Reference/Data-Query-Language/subqueries/subquery-with-any-some.md + - SUBQUERY with ALL: MatrixOne/Reference/SQL-Reference/Data-Query-Language/subqueries/subquery-with-all.md + - SUBQUERY with EXISTS: MatrixOne/Reference/SQL-Reference/Data-Query-Language/subqueries/subquery-with-exists.md + - SUBQUERY with IN: MatrixOne/Reference/SQL-Reference/Data-Query-Language/subqueries/subquery-with-in.md - With CTE: MatrixOne/Reference/SQL-Reference/Data-Query-Language/with-cte.md - Combining Queries: - Combining Queries Overview: MatrixOne/Reference/SQL-Reference/Data-Query-Language/union-intersect-minus-overview.md @@ -570,6 +577,7 @@ nav: - CEILING(): MatrixOne/Reference/Functions-and-Operators/Mathematical/ceiling.md - COS(): MatrixOne/Reference/Functions-and-Operators/Mathematical/cos.md - COT(): MatrixOne/Reference/Functions-and-Operators/Mathematical/cot.md + - CRC32(): MatrixOne/Reference/Functions-and-Operators/Mathematical/crc32.md - EXP(): MatrixOne/Reference/Functions-and-Operators/Mathematical/exp.md - FLOOR(): MatrixOne/Reference/Functions-and-Operators/Mathematical/floor.md - LN(): MatrixOne/Reference/Functions-and-Operators/Mathematical/ln.md @@ -643,6 +651,7 @@ nav: - SUBVECTOR(): MatrixOne/Reference/Functions-and-Operators/Vector/subvector.md - VECTOR_DIMS(): MatrixOne/Reference/Functions-and-Operators/Vector/vector_dims.md - Table: + - GENERATE_SERIES(): MatrixOne/Reference/Functions-and-Operators/Table/generate_series.md - UNNEST(): MatrixOne/Reference/Functions-and-Operators/Table/unnest.md - Vector: - Arithemetic Operators: MatrixOne/Reference/Functions-and-Operators/Vector/arithmetic.md @@ -710,6 +719,7 @@ nav: - SQL FAQs: MatrixOne/FAQs/sql-faqs.md - Release Notes: - Release Timeline: MatrixOne/Release-Notes/release-timeline.md + - v24.2.0.1: MatrixOne/Release-Notes/v24.2.0.1.md - v24.2.0.0: MatrixOne/Release-Notes/v24.2.0.0.md - v24.1.2.4: MatrixOne/Release-Notes/v24.1.2.4.md - v24.1.2.3: MatrixOne/Release-Notes/v24.1.2.3.md