[ 1746266 ] Convert fails for type only ALTER...MODIFY statement
This commit is contained in:
parent
9a929f1dc6
commit
09de60d04c
|
@ -1000,8 +1000,8 @@ public class Convert_PostgreSQL extends Convert_SQL92 {
|
|||
else
|
||||
{
|
||||
int typeEnd = rest.indexOf(' ');
|
||||
type = rest.substring(0, typeEnd).trim();
|
||||
rest = rest.substring(typeEnd);
|
||||
type = typeEnd > 0 ? rest.substring(0, typeEnd).trim() : rest;
|
||||
rest = typeEnd > 0 ? rest.substring(typeEnd) : "";
|
||||
}
|
||||
|
||||
if (rest.toUpperCase().indexOf(" DEFAULT ") != -1) {
|
||||
|
|
|
@ -78,6 +78,12 @@ public final class Convert_PostgreSQLTest extends TestCase{
|
|||
sqe = "ALTER TABLE XX ADD COLUMN A VARCHAR(10) DEFAULT '--'";
|
||||
r = convert.convert(sql);
|
||||
assertEquals(sqe, r[0].trim());
|
||||
|
||||
//[ adempiere-Bugs-1746266 ]
|
||||
sql = "ALTER TABLE someTableName MODIFY someColumnName NVARCHAR2(64)";
|
||||
sqe = "insert into t_alter_column values('sometablename','someColumnName','VARCHAR(64)',null,null)";
|
||||
r = convert.convert(sql);
|
||||
assertEquals(sqe, r[0].trim());
|
||||
}
|
||||
|
||||
// Convert.recoverQuotedStrings() error on strings with "<-->" - teo_sarca [ 1705768 ]
|
||||
|
|
Loading…
Reference in New Issue