You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: EN/modules/ROOT/pages/master/6.3.5.adoc
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,7 +24,7 @@ IvorySQL provides Oracle-compatible NLS (National Language Support) parameter fu
24
24
=== Parameter `nls_length_semantics`
25
25
26
26
In IvorySQL, data types have an attribute modifier called typmod, which provides additional information about the type. For example, in `VARCHAR(n)`, n is the type modifier. When creating or modifying table columns, you can specify the length type, such as:
@@ -33,7 +33,7 @@ For columns of type `CHAR`, `VARCHAR`, or `VARCHAR2`, if the length type is not
33
33
Note that the `nls_length_semantics` parameter only affects newly created columns and has no impact on existing columns.
34
34
35
35
In the syntax parsing file ora_gram.y, the following code converts the original `CHAR`, `VARCHAR`, or `VARCHAR2` types to oracharchar or oracharbyte based on `nls_length_semantics`.
36
-
```
36
+
```c
37
37
CharacterWithLength: character '(' Iconst ')'
38
38
{
39
39
if (ORA_PARSER == compatible_db)
@@ -67,7 +67,7 @@ CharacterWithLength: character '(' Iconst ')'
67
67
```
68
68
69
69
The input/output functions for the oracharchar and oracharbyte data types in IvorySQL include:
70
-
```
70
+
```c
71
71
oravarcharchartypmodout()
72
72
oravarcharbytetypmodout()
73
73
oracharbytetypmodout()
@@ -77,7 +77,7 @@ oracharchartypmodout()
77
77
These functions call the C-language function `anychar_typmodout()`, which adjusts the output to include `BYTE` or `CHAR` based on the value of `nls_length_semantics`.
78
78
79
79
Another role of `nls_length_semantics` is to limit column lengths in tables. If the original `VARCHAR` type is converted to `oracharchar`, the function `oravarcharchar()` is called, and `pg_mbcharcliplen()` calculates the character length instead of the byte length.
This parameter is defined as an int value, where the lower four bits indicate whether to ignore NLS parameter influence on the corresponding date-time formats. The mask definitions are:
109
-
```
109
+
```c
110
110
#define ORADATE_MASK 0x01
111
111
#define ORATIMESTAMP_MASK 0x02
112
112
#define ORATIMESTAMPTZ_MASK 0x04
@@ -115,7 +115,7 @@ This parameter is defined as an int value, where the lower four bits indicate wh
115
115
116
116
In the source code, this GUC parameter is used in the following functions:
117
117
118
-
```
118
+
```c
119
119
oradate_in()
120
120
oratimestamp_in()
121
121
oratimestampltz_in()
@@ -127,7 +127,7 @@ If the corresponding mask is set, the native PostgreSQL processing function is c
These three GUC parameters serve as format strings in the function `ora_do_to_timestamp()` for checking and parsing input strings. Their default values are:
0 commit comments