Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
1d468ee0
Commit
1d468ee0
authored
Jul 30, 2021
by
Olivier Bertrand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix slow processing of pretty json files by BSON tables
parent
fc98a6d5
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
8 deletions
+12
-8
storage/connect/tabbson.cpp
storage/connect/tabbson.cpp
+10
-8
storage/connect/tabbson.h
storage/connect/tabbson.h
+2
-0
No files found.
storage/connect/tabbson.cpp
View file @
1d468ee0
...
...
@@ -376,7 +376,7 @@ int BSONDISC::GetColumns(PGLOBAL g, PCSZ db, PCSZ dsn, PTOS topt)
}
// endswitch ReadDB
}
else
jsp
=
bp
->
Get
ArrayValue
(
bdp
,
i
);
jsp
=
bp
->
Get
Next
(
jsp
);
if
(
!
(
row
=
(
jsp
)
?
bp
->
GetObject
(
jsp
)
:
NULL
))
break
;
...
...
@@ -2185,7 +2185,9 @@ void BSONCOL::WriteColumn(PGLOBAL g)
TDBBSON
::
TDBBSON
(
PGLOBAL
g
,
PBDEF
tdp
,
PTXF
txfp
)
:
TDBBSN
(
g
,
tdp
,
txfp
)
{
Docp
=
NULL
;
Docrow
=
NULL
;
Multiple
=
tdp
->
Multiple
;
Docsize
=
0
;
Done
=
Changed
=
false
;
Bp
->
SetPretty
(
2
);
}
// end of TDBBSON standard constructor
...
...
@@ -2193,7 +2195,9 @@ TDBBSON::TDBBSON(PGLOBAL g, PBDEF tdp, PTXF txfp) : TDBBSN(g, tdp, txfp)
TDBBSON
::
TDBBSON
(
PBTDB
tdbp
)
:
TDBBSN
(
tdbp
)
{
Docp
=
tdbp
->
Docp
;
Docrow
=
tdbp
->
Docrow
;
Multiple
=
tdbp
->
Multiple
;
Docsize
=
tdbp
->
Docsize
;
Done
=
tdbp
->
Done
;
Changed
=
tdbp
->
Changed
;
}
// end of TDBBSON copy constructor
...
...
@@ -2374,6 +2378,7 @@ int TDBBSON::MakeDocument(PGLOBAL g)
}
// endif jsp
Docsize
=
Bp
->
GetSize
(
Docp
);
Done
=
true
;
return
RC_OK
;
}
// end of MakeDocument
...
...
@@ -2388,7 +2393,7 @@ int TDBBSON::Cardinality(PGLOBAL g)
else
if
(
Cardinal
<
0
)
{
if
(
!
Multiple
)
{
if
(
MakeDocument
(
g
)
==
RC_OK
)
Cardinal
=
Bp
->
GetSize
(
Docp
)
;
Cardinal
=
Docsize
;
}
else
return
10
;
...
...
@@ -2530,12 +2535,9 @@ int TDBBSON::ReadDB(PGLOBAL)
NextSame
=
false
;
M
++
;
rc
=
RC_OK
;
}
else
if
(
++
Fpos
<
(
signed
)
Bp
->
GetSize
(
Docp
))
{
Row
=
Bp
->
GetArrayValue
(
Docp
,
Fpos
);
if
(
Row
->
Type
==
TYPE_JVAL
)
Row
=
Bp
->
GetBson
(
Row
);
}
else
if
(
++
Fpos
<
Docsize
)
{
Docrow
=
(
Docrow
)
?
Bp
->
GetNext
(
Docrow
)
:
Bp
->
GetArrayValue
(
Docp
,
Fpos
);
Row
=
(
Docrow
->
Type
==
TYPE_JVAL
)
?
Bp
->
GetBson
(
Docrow
)
:
Docrow
;
SameRow
=
0
;
M
=
1
;
rc
=
RC_OK
;
...
...
storage/connect/tabbson.h
View file @
1d468ee0
...
...
@@ -318,7 +318,9 @@ class DllExport TDBBSON : public TDBBSN {
// Members
PBVAL
Docp
;
// The document array
PBVAL
Docrow
;
// Document row
int
Multiple
;
// 0: No 1: DIR 2: Section 3: filelist
int
Docsize
;
// The document size
bool
Done
;
// True when document parsing is done
bool
Changed
;
// After Update, Insert or Delete
};
// end of class TDBBSON
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment