samasri / omr

Eclipse OMR™ Cross platform components for building reliable, high performance language runtimes
http://www.eclipse.org/omr
Other
0 stars 2 forks source link

IDs are not consistent #32

Closed samasri closed 6 years ago

samasri commented 6 years ago

Suppose we have the following 2 hierarchies: C --> B --> A F --> E --> D Each of these classes have a function a() The following is the functions table:

ID Signature Class (first occurrence)
1 a() A
2 a() D

The overrides table would be the following:

FunctionID BaseClassName OverridingClassName
1 A B
1 B C
1 D E
1 E F

Although for the last 2 rows in the overriddes table, the ID should be 2

samasri commented 6 years ago

The plan is to remove IDs of functions and make the primary key for functions signature and classID

samasri commented 6 years ago

When changing the primary keys in the functions table, I ran into the error of having duplicate primary keys. It turned out that some of the rows in allFunctions would be referring to the same function but having different isFirstOccurrence or isVirtual values. Two examples are below for reference:

FunctionName; FunctionSignature; IsFirstOccurence; Namespace; ClassName; isImplicit; isVirtual

operator delete; operator delete(void *,TR::Region &); 0; TR;VPConstraint; 0; 0
operator delete; operator delete(void *,TR::Region &); 1; TR; VPConstraint; 0; 0

rexBits, rexBits(); 1; OMR::X86; Instruction; 0; 1
rexBits, rexBits(); 1; OMR::X86; Instruction; 0; 0
samasri commented 6 years ago

Had an issue adding functions with same signature characters, but different case-sensitivity since MySQL is not case-sensitive by default. Added a line to the table creation to make it case sensitive: ALTER TABLE [tableName] CONVERT TO CHARACTER SET latin1 COLLATE latin1_general_cs; Example of cases that caused errors:

FunctionName; FunctionSignature; IsFirstOccurence; Namespace; ClassName; isImplicit; isVirtual

SetUp;SetUp();1;testing;Environment;0;1
Setup;Setup();1;testing;Environment;0;1