File tree Expand file tree Collapse file tree 5 files changed +28
-11
lines changed Expand file tree Collapse file tree 5 files changed +28
-11
lines changed Original file line number Diff line number Diff line change @@ -15246,6 +15246,12 @@ CharacterWithLength:  character '(' Iconst ')'
1524615246						}
1524715247						else
1524815248						{
15249+ 							if ($3 > CHAR_TYPE_LENGTH_MAX)
15250+ 								ereport(ERROR,
15251+ 									(errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
15252+ 									errmsg("specified length too long for its datatype"),
15253+ 									parser_errposition(@3)));
15254+ 
1524915255							if (nls_length_semantics == NLS_LENGTH_CHAR)
1525015256								$1 = "oracharchar";
1525115257							else
Original file line number Diff line number Diff line change 1919#define  ORA_SEARCH_PATH  "sys,\"$user\", public"
2020#define  DB_MODE_PARMATER  "ivorysql.database_mode"
2121
22+ #define  CHAR_TYPE_LENGTH_MAX     2000
23+ 
2224typedef  enum  DBMode 
2325{
2426	DB_PG  =  0 ,
Original file line number Diff line number Diff line change @@ -1946,18 +1946,18 @@ DROP TABLE toasttest;
19461946-- corner case in packed-varlena handling: even though small, the compressed
19471947-- datum must be given a 4-byte header because there are no bits to indicate
19481948-- compression in a 1-byte header
1949- CREATE TABLE toasttest (c char(4096 ));
1949+ CREATE TABLE toasttest (c char(2000 ));
19501950INSERT INTO toasttest VALUES('x');
19511951SELECT length(c), c::text FROM toasttest;
19521952 length | c 
19531953--------+---
1954-    4096  | x
1954+    2000  | x
19551955(1 row)
19561956
19571957SELECT c FROM toasttest;
1958-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 c                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
1959- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1960-  x                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
1958+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         c                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         
1959+ ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1960+  x                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
19611961(1 row)
19621962
19631963DROP TABLE toasttest;
@@ -1970,6 +1970,10 @@ SELECT length('abcdef') AS "length_6";
19701970        6
19711971(1 row)
19721972
1973+ CREATE TABLE toasttest (c char(2001));
1974+ ERROR:  specified length too long for its datatype
1975+ LINE 1: CREATE TABLE toasttest (c char(2001));
1976+                                        ^
19731977--
19741978-- test strpos
19751979--
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments