Skip to content

Commit

Permalink
1
Browse files Browse the repository at this point in the history
  • Loading branch information
liugddx committed Feb 28, 2024
1 parent d43b8a0 commit ad38d2d
Show file tree
Hide file tree
Showing 4 changed files with 116 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
{
"title": "random_bytes",
"language": "en"
}
---

<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->

## random_bytes
### description

The `random_bytes` function generates a sequence of random bytes.

#### Syntax

```sql
VARCHAR random_bytes(INT len)
```

### Parameters

- len: The `random_bytes` function takes a single argument, which specifies the length of the generated random byte sequence.

### example

```
mysql> select random_bytes(7);
+------------------------------------------------+
| random_bytes(7) |
+------------------------------------------------+
| 0x53edd97401fb6d |
+------------------------------------------------+
```

### keywords
RANDOM BYTES
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
{
"title": "url_decode",
"language": "en"
}
---

<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->

## url_decode
### description

random_bytes函数用于生成随机字节序列。

#### Syntax

```sql
VARCHAR url_decode(INT len)
```

### Parameters

- url: 三该参数指定生成的随机字节序列的长度。

### example

```
mysql> select random_bytes(7);
+------------------------------------------------+
| random_bytes(7) |
+------------------------------------------------+
| 0x53edd97401fb6d |
+------------------------------------------------+
```

### keywords
RANDOM BYTES
Original file line number Diff line number Diff line change
Expand Up @@ -1101,3 +1101,9 @@ string3
string3
string3

-- !sql_random_bytes --
0x84b729ce8c0f49

-- !sql_random_bytes --
\N

Original file line number Diff line number Diff line change
Expand Up @@ -99,4 +99,6 @@ suite("nereids_scalar_fn_R") {
qt_sql_rtrim_Varchar_Varchar_notnull "select rtrim(kvchrs1, '1') from fn_test_not_nullable order by kvchrs1"
qt_sql_rtrim_String_String "select rtrim(kstr, '1') from fn_test order by kstr"
qt_sql_rtrim_String_String_notnull "select rtrim(kstr, '1') from fn_test_not_nullable order by kstr"
qt_sql_random_bytes "SELECT random_bytes(7);"
qt_sql_random_bytes "SELECT random_bytes(null);"
}

0 comments on commit ad38d2d

Please sign in to comment.