Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 908587 Details for
Bug 1108219
4.9.0-6 broke build of postgresql on AArch64
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
rh1108219.c
rh1108219.c (text/plain), 6.62 KB, created by
Jakub Jelinek
on 2014-06-13 13:47:32 UTC
(
hide
)
Description:
rh1108219.c
Filename:
MIME Type:
Creator:
Jakub Jelinek
Created:
2014-06-13 13:47:32 UTC
Size:
6.62 KB
patch
obsolete
>typedef unsigned int Oid; >typedef __SIZE_TYPE__ size_t; >typedef __UINTPTR_TYPE__ uintptr_t; >typedef char bool; >typedef char *Pointer; >typedef signed int int32; >typedef unsigned char uint8; >typedef unsigned int uint32; >typedef size_t Size; >typedef struct varlena text; >typedef struct MemoryContextData *MemoryContext; >extern void *palloc(Size size); >typedef union { struct { uint32 va_header; char va_data[1]; } va_4byte; struct { uint32 va_header; uint32 va_rawsize; char va_data[1]; } va_compressed; } varattrib_4b; >typedef struct { uint8 va_header; char va_data[1]; } varattrib_1b; >typedef struct { uint8 va_header; uint8 va_len_1be; char va_data[1]; } varattrib_1b_e; >typedef uintptr_t Datum; >typedef struct Node *fmNodePtr; >typedef struct FunctionCallInfoData *FunctionCallInfo; >typedef Datum (*PGFunction) (FunctionCallInfo fcinfo); >typedef struct FmgrInfo { PGFunction fn_addr; Oid fn_oid; short fn_nargs; bool fn_strict; bool fn_retset; unsigned char fn_stats; void *fn_extra; MemoryContext fn_mcxt; fmNodePtr fn_expr; } FmgrInfo; >typedef struct FunctionCallInfoData { FmgrInfo *flinfo; fmNodePtr context; fmNodePtr resultinfo; Oid fncollation; bool isnull; short nargs; Datum arg[100]; bool argnull[100]; } FunctionCallInfoData; >typedef struct spgChooseIn { Datum datum; Datum leafDatum; int level; bool allTheSame; bool hasPrefix; Datum prefixDatum; int nNodes; Datum *nodeLabels; } spgChooseIn; >typedef enum spgChooseResultType { spgMatchNode = 1, spgAddNode, spgSplitTuple } spgChooseResultType; >typedef struct spgChooseOut { spgChooseResultType resultType; union { struct { int nodeN; int levelAdd; Datum restDatum; } matchNode; struct { Datum nodeLabel; int nodeN; } addNode; struct { bool prefixHasPrefix; Datum prefixPrefixDatum; Datum nodeLabel; bool postfixHasPrefix; Datum postfixPrefixDatum; } splitTuple; } result; } spgChooseOut; >extern struct varlena *pg_detoast_datum_packed(struct varlena * datum); >__attribute__((noinline)) static Datum >formTextDatum(const char *data, int datalen) >{ > char *p; > p = (char *) palloc(datalen + ((int32) sizeof(int32))); > if (datalen + 1 <= 0x7F) > { > (((varattrib_1b *) (p))->va_header = (((uint8) (datalen + 1)) << 1) | 0x01); > if (datalen) > __builtin_memcpy(p + 1, data, datalen); > } > else > { > (((varattrib_4b *) (p))->va_4byte.va_header = (((uint32) (datalen + ((int32) sizeof(int32)))) << 2)); > __builtin_memcpy(p + ((int32) sizeof(int32)), data, datalen); > } > return ((Datum) (p)); >} >static int >commonPrefix(const char *a, const char *b, int lena, int lenb) >{ > int i = 0; > while (i < lena && i < lenb && *a == *b) > { > a++; > b++; > i++; > } > return i; >} >static bool >searchChar(Datum *nodeLabels, int nNodes, uint8 c, int *i) >{ > int StopLow = 0, > StopHigh = nNodes; > while (StopLow < StopHigh) > { > int StopMiddle = (StopLow + StopHigh) >> 1; > uint8 middle = ((uint8) (((Datum) (nodeLabels[StopMiddle])) & 0x000000ff)); > if (c < middle) > StopHigh = StopMiddle; > else if (c > middle) > StopLow = StopMiddle + 1; > else > { > *i = StopMiddle; > return ((bool) 1); > } > } > *i = StopHigh; > return ((bool) 0); >} >Datum >spg_text_choose(FunctionCallInfo fcinfo) >{ > spgChooseIn *in = (spgChooseIn *) ((Pointer) ((fcinfo->arg[0]))); > spgChooseOut *out = (spgChooseOut *) ((Pointer) ((fcinfo->arg[1]))); > text *inText = ((text *) pg_detoast_datum_packed((struct varlena *) ((Pointer) (in->datum)))); > char *inStr = (((((varattrib_1b *) (inText))->va_header & 0x01) == 0x01) ? (((varattrib_1b *) (inText))->va_data) : (((varattrib_4b *) (inText))->va_4byte.va_data)); > int inSize = (((((varattrib_1b *) (inText))->va_header) == 0x01) ? (((varattrib_1b_e *) (inText))->va_len_1be)-2 : (((((varattrib_1b *) (inText))->va_header & 0x01) == 0x01) ? ((((varattrib_1b *) (inText))->va_header >> 1) & 0x7F)-1 : ((((varattrib_4b *) (inText))->va_4byte.va_header >> 2) & 0x3FFFFFFF)-((int32) sizeof(int32)))); > uint8 nodeChar = '\0'; > int i = 0; > int commonLen = 0; > if (in->hasPrefix) > { > text *prefixText = ((text *) pg_detoast_datum_packed((struct varlena *) ((Pointer) (in->prefixDatum)))); > char *prefixStr = (((((varattrib_1b *) (prefixText))->va_header & 0x01) == 0x01) ? (((varattrib_1b *) (prefixText))->va_data) : (((varattrib_4b *) (prefixText))->va_4byte.va_data)); > int prefixSize = (((((varattrib_1b *) (prefixText))->va_header) == 0x01) ? (((varattrib_1b_e *) (prefixText))->va_len_1be)-2 : (((((varattrib_1b *) (prefixText))->va_header & 0x01) == 0x01) ? ((((varattrib_1b *) (prefixText))->va_header >> 1) & 0x7F)-1 : ((((varattrib_4b *) (prefixText))->va_4byte.va_header >> 2) & 0x3FFFFFFF)-((int32) sizeof(int32)))); > commonLen = commonPrefix(inStr + in->level, > prefixStr, > inSize - in->level, > prefixSize); > if (commonLen == prefixSize) > { > if (inSize - in->level > commonLen) > nodeChar = *(uint8 *) (inStr + in->level + commonLen); > else > nodeChar = '\0'; > } > else > { > out->resultType = spgSplitTuple; > if (commonLen == 0) > { > out->result.splitTuple.prefixHasPrefix = ((bool) 0); > } > else > { > out->result.splitTuple.prefixHasPrefix = ((bool) 1); > out->result.splitTuple.prefixPrefixDatum = > formTextDatum(prefixStr, commonLen); > } > out->result.splitTuple.nodeLabel = > ((Datum) (((Datum) (*(prefixStr + commonLen))) & 0x000000ff)); > if (prefixSize - commonLen == 1) > { > out->result.splitTuple.postfixHasPrefix = ((bool) 0); > } > else > { > out->result.splitTuple.postfixHasPrefix = ((bool) 1); > out->result.splitTuple.postfixPrefixDatum = > formTextDatum(prefixStr + commonLen + 1, > prefixSize - commonLen - 1); > } > return (Datum) 0; > } > } > else if (inSize > in->level) > { > nodeChar = *(uint8 *) (inStr + in->level); > } > else > { > nodeChar = '\0'; > } > if (searchChar(in->nodeLabels, in->nNodes, nodeChar, &i)) > { > out->resultType = spgMatchNode; > out->result.matchNode.nodeN = i; > out->result.matchNode.levelAdd = commonLen + 1; > if (inSize - in->level - commonLen - 1 > 0) > out->result.matchNode.restDatum = > formTextDatum(inStr + in->level + commonLen + 1, > inSize - in->level - commonLen - 1); > else > out->result.matchNode.restDatum = > formTextDatum(((void *)0), 0); > } > else if (in->allTheSame) > { > out->resultType = spgSplitTuple; > out->result.splitTuple.prefixHasPrefix = in->hasPrefix; > out->result.splitTuple.prefixPrefixDatum = in->prefixDatum; > out->result.splitTuple.nodeLabel = ((Datum) (((Datum) ('\0')) & 0x000000ff)); > out->result.splitTuple.postfixHasPrefix = ((bool) 0); > } > else > { > out->resultType = spgAddNode; > out->result.addNode.nodeLabel = ((Datum) (((Datum) (nodeChar)) & 0x000000ff)); > out->result.addNode.nodeN = i; > } > return (Datum) 0; >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 1108219
:
908547
|
908550
| 908587