Skip to content

unexpect field layout for sqlite3 #517

Description

@luoliwoshang
struct sqlite3_index_info {
  int nConstraint;       
  struct sqlite3_index_constraint {
     int iColumn;           
     unsigned char op;       
     unsigned char usable;     
     int iTermOffset;        
  } *aConstraint;          
  int nOrderBy;            
  struct sqlite3_index_orderby {
     int iColumn;             
     unsigned char desc;    
  } *aOrderBy;            
  struct sqlite3_index_constraint_usage {
    int argvIndex;          
    unsigned char omit;      
  } *aConstraintUsage;
  int idxNum;             
  char *idxStr;              
  int needToFreeIdxStr;     
  int orderByConsumed;    
  double estimatedCost;          
  sqlite3_int64 estimatedRows;   
  int idxFlags;  
  sqlite3_uint64 colUsed;  
};

but only got

https://github.com/goplus/llcppg/blob/23c8a9e466c139c6af3ed9d7b19d072f5aa36852/_cmptest/testdata/sqlite3/3.49.1/sqlite3/sqlite3.go#L5643C1-L5657C2

https://github.com/goplus/llcppg/blob/23c8a9e466c139c6af3ed9d7b19d072f5aa36852/_cmptest/testdata/sqlite3/3.49.1/sqlite3/sqlite3.go#L5691C1-L5701C2

type IndexInfo struct {
	NConstraint      c.Int
	AConstraint      *IndexConstraint
	NOrderBy         c.Int
	AOrderBy         *IndexOrderby
	AConstraintUsage *IndexConstraintUsage
	IdxNum           c.Int
	IdxStr           *c.Char
	NeedToFreeIdxStr c.Int
	OrderByConsumed  c.Int
	EstimatedCost    c.Double
	EstimatedRows    Int64
	IdxFlags         c.Int
	ColUsed          Uint64
}
type IndexConstraint struct {
	Unused [8]uint8
}

type IndexOrderby struct {
	Unused [8]uint8
}

type IndexConstraintUsage struct {
	Unused [8]uint8
}

the named nested struct pointer actuall have type field not only a forward decl

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions