Project

General

Profile

Bug #6478

validate arguments for DYNAMIC-CURRENT-VALUE, DYNAMIC-SET-VALUE and DYNAMIC-NEXT-VALUE

Added by Constantin Asofiei almost 2 years ago. Updated almost 2 years ago.

Status:
Test
Priority:
High
Target version:
-
Start date:
Due date:
% Done:

100%

billable:
No
vendor_id:
GCD
case_num:

History

#2 Updated by Constantin Asofiei almost 2 years ago

Ovidiu, argument validation is not implemented for any of the DYNAMIC-CURRENT-VALUE, DYNAMIC-SET-VALUE and DYNAMIC-NEXT-VALUE cases. This can produce NullPointerExceptions or other abends.

Please fix this in 6129a.

#3 Updated by Ovidiu Maxiniuc almost 2 years ago

  • Status changed from New to WIP
  • % Done changed from 0 to 100
Fixed various aspects related to sequences:
  • Added validation for specific methods. Extracted common code in worker procedures;
  • Fixed error messages;
  • Fixed default MIN value for sequences;
  • Added support for using any numerical expressions in setters.

Committed revision 13901.

#4 Updated by Constantin Asofiei almost 2 years ago

Ovidiu, the sequence names should be lowercased in the map, see this patch:

### Eclipse Workspace Patch 1.0
#P p2j6129a
Index: src/com/goldencode/p2j/persist/SequenceManager.java
===================================================================
--- src/com/goldencode/p2j/persist/SequenceManager.java    (revision 3648)
+++ src/com/goldencode/p2j/persist/SequenceManager.java    (working copy)
@@ -1139,7 +1139,7 @@
                                                                      k -> new HashMap<>());

       // add the object to database list
-      dbSeqMap.put(sqlName, sequence);
+      dbSeqMap.put(sqlName.toLowerCase(), sequence);

       // add it to legacy map only when sqlName != legName
       if (!sqlName.equals(legName))

#5 Updated by Ovidiu Maxiniuc almost 2 years ago

Constantin Asofiei wrote:

Ovidiu, the sequence names should be lowercased in the map.

The sequence sql-name should be already in lowercase because it is computes like this:

         <!-- convert Progress sequence name to a SQL-legal sequence name -->
         <action>seqName = name.convert(text, name.table)</action>

Which makes me curious: what is the legacy name of sequence you encountered?

#6 Updated by Constantin Asofiei almost 2 years ago

Ovidiu Maxiniuc wrote:

Constantin Asofiei wrote:

Ovidiu, the sequence names should be lowercased in the map.

The sequence sql-name should be already in lowercase because it is computes like this:
[...]

Which makes me curious: what is the legacy name of sequence you encountered?

This is with 'minimal' conversion rules, and the SQL is not lowercased.

#7 Updated by Ovidiu Maxiniuc almost 2 years ago

I understand. In this case the lowercase keys are required.

#8 Updated by Constantin Asofiei almost 2 years ago

Ovidiu Maxiniuc wrote:

I understand. In this case the lowercase keys are required.

Please ensure that 'sequences' value maps have the sequence name keys lowercased, everywhere is used. I haven't checked all.

#9 Updated by Constantin Asofiei almost 2 years ago

  • Status changed from WIP to Test

Fixed SQL names in 6129a/13908

#10 Updated by Ovidiu Maxiniuc almost 2 years ago

Constantin Asofiei wrote:

Please ensure that 'sequences' value maps have the sequence name keys lowercased, everywhere is used. I haven't checked all.

The sequences structure is not dynamic. It is populated when the database is loaded and queried when information about the sequence is needed. So there are only two places where the field is accessed:
  • the getter getSequence() already had the sequence name lowercased;
  • you updated the setter in 6129a/13908.

All is OK now.

Also available in: Atom PDF