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
ce2619a6
Commit
ce2619a6
authored
Jun 08, 2004
by
tomas@poseidon.bredbandsbolaget.se
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
some ndb printout cleanup
parent
71d7838f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
111 deletions
+35
-111
ndb/src/ndbapi/NdbDictionary.cpp
ndb/src/ndbapi/NdbDictionary.cpp
+21
-21
ndb/test/src/NDBT_ResultRow.cpp
ndb/test/src/NDBT_ResultRow.cpp
+1
-7
ndb/test/src/NDBT_Table.cpp
ndb/test/src/NDBT_Table.cpp
+13
-83
No files found.
ndb/src/ndbapi/NdbDictionary.cpp
View file @
ce2619a6
...
...
@@ -807,67 +807,67 @@ NdbOut& operator <<(NdbOut& ndbout, const NdbDictionary::Column::Type type)
{
switch
(
type
){
case
NdbDictionary
:
:
Column
::
Bigunsigned
:
ndbout
<<
"
[Bigunsigned]
"
;
ndbout
<<
"
Bigunsigned
"
;
break
;
case
NdbDictionary
:
:
Column
::
Unsigned
:
ndbout
<<
"
[Unsigned]
"
;
ndbout
<<
"
Unsigned
"
;
break
;
case
NdbDictionary
:
:
Column
::
Smallunsigned
:
ndbout
<<
"
[Smallunsigned]
"
;
ndbout
<<
"
Smallunsigned
"
;
break
;
case
NdbDictionary
:
:
Column
::
Tinyunsigned
:
ndbout
<<
"
[Tinyunsigned]
"
;
ndbout
<<
"
Tinyunsigned
"
;
break
;
case
NdbDictionary
:
:
Column
::
Bigint
:
ndbout
<<
"
[Bigint]
"
;
ndbout
<<
"
Bigint
"
;
break
;
case
NdbDictionary
:
:
Column
::
Int
:
ndbout
<<
"
[Int]
"
;
ndbout
<<
"
Int
"
;
break
;
case
NdbDictionary
:
:
Column
::
Smallint
:
ndbout
<<
"
[Smallint]
"
;
ndbout
<<
"
Smallint
"
;
break
;
case
NdbDictionary
:
:
Column
::
Tinyint
:
ndbout
<<
"
[Tinyint]
"
;
ndbout
<<
"
Tinyint
"
;
break
;
case
NdbDictionary
:
:
Column
::
Char
:
ndbout
<<
"
[Char]
"
;
ndbout
<<
"
Char
"
;
break
;
case
NdbDictionary
:
:
Column
::
Varchar
:
ndbout
<<
"
[Varchar]
"
;
ndbout
<<
"
Varchar
"
;
break
;
case
NdbDictionary
:
:
Column
::
Float
:
ndbout
<<
"
[Float]
"
;
ndbout
<<
"
Float
"
;
break
;
case
NdbDictionary
:
:
Column
::
Double
:
ndbout
<<
"
[Double]
"
;
ndbout
<<
"
Double
"
;
break
;
case
NdbDictionary
:
:
Column
::
Mediumint
:
ndbout
<<
"
[Mediumint]
"
;
ndbout
<<
"
Mediumint
"
;
break
;
case
NdbDictionary
:
:
Column
::
Mediumunsigned
:
ndbout
<<
"
[Mediumunsigend]
"
;
ndbout
<<
"
Mediumunsigend
"
;
break
;
case
NdbDictionary
:
:
Column
::
Binary
:
ndbout
<<
"
[Binary]
"
;
ndbout
<<
"
Binary
"
;
break
;
case
NdbDictionary
:
:
Column
::
Varbinary
:
ndbout
<<
"
[Varbinary]
"
;
ndbout
<<
"
Varbinary
"
;
break
;
case
NdbDictionary
:
:
Column
::
Decimal
:
ndbout
<<
"
[Decimal]
"
;
ndbout
<<
"
Decimal
"
;
break
;
case
NdbDictionary
:
:
Column
::
Timespec
:
ndbout
<<
"
[Timespec]
"
;
ndbout
<<
"
Timespec
"
;
break
;
case
NdbDictionary
:
:
Column
::
Blob
:
ndbout
<<
"
[Blob]
"
;
ndbout
<<
"
Blob
"
;
break
;
case
NdbDictionary
:
:
Column
::
Undefined
:
ndbout
<<
"
[Undefined]
"
;
ndbout
<<
"
Undefined
"
;
break
;
default:
ndbout
<<
"
[Unknown type]"
;
ndbout
<<
"
Unknown type="
<<
(
Uint32
)
type
;
break
;
}
...
...
ndb/test/src/NDBT_ResultRow.cpp
View file @
ce2619a6
...
...
@@ -110,16 +110,10 @@ BaseString NDBT_ResultRow::c_str() {
return
str
;
}
/**
* TODO This should share the same printer function as in
* NdbEventOperationImpl.cpp, using new types of course :)
*/
NdbOut
&
operator
<<
(
NdbOut
&
ndbout
,
const
NDBT_ResultRow
&
res
)
{
for
(
int
i
=
0
;
i
<
res
.
cols
;
i
++
)
ndbout
<<
res
.
data
[
i
]
;
ndbout
<<
*
(
res
.
data
[
i
])
<<
"
\t
"
;
return
ndbout
;
}
...
...
ndb/test/src/NDBT_Table.cpp
View file @
ce2619a6
...
...
@@ -14,105 +14,35 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include
"NDBT_Table.hpp"
#include
<NDBT_Table.hpp>
#include <NdbTimer.hpp>
#include <NDBT.hpp>
class
NdbOut
&
operator
<<
(
class
NdbOut
&
ndbout
,
const
NDBT_Attribute
&
attr
){
NdbDictionary
::
Column
::
Type
type
=
attr
.
getType
();
bool
key
=
attr
.
getPrimaryKey
();
bool
null
=
attr
.
getNullable
();
ndbout
<<
attr
.
getName
()
<<
" "
;
char
tmp
[
100
];
if
(
attr
.
getLength
()
!=
1
)
snprintf
(
tmp
,
100
,
" [%d]"
,
attr
.
getLength
());
else
tmp
[
0
]
=
0
;
ndbout
<<
attr
.
getName
()
<<
" "
<<
type
;
switch
(
type
){
case
NdbDictionary
:
:
Column
::
Tinyint
:
ndbout
<<
"Tinyint"
<<
tmp
;
break
;
case
NdbDictionary
:
:
Column
::
Tinyunsigned
:
ndbout
<<
"Tinyunsigned"
<<
tmp
;
break
;
case
NdbDictionary
:
:
Column
::
Smallint
:
ndbout
<<
"Smallint"
<<
tmp
;
break
;
case
NdbDictionary
:
:
Column
::
Smallunsigned
:
ndbout
<<
"Smallunsigned"
<<
tmp
;
break
;
case
NdbDictionary
:
:
Column
::
Mediumint
:
ndbout
<<
"Mediumint"
<<
tmp
;
break
;
case
NdbDictionary
:
:
Column
::
Mediumunsigned
:
ndbout
<<
"Mediumunsigned"
<<
tmp
;
break
;
case
NdbDictionary
:
:
Column
::
Int
:
ndbout
<<
"Int"
<<
tmp
;
break
;
case
NdbDictionary
:
:
Column
::
Unsigned
:
ndbout
<<
"Unsigned"
<<
tmp
;
break
;
case
NdbDictionary
:
:
Column
::
Bigint
:
ndbout
<<
"Bigint"
<<
tmp
;
break
;
case
NdbDictionary
:
:
Column
::
Bigunsigned
:
ndbout
<<
"Bigunsigned"
<<
tmp
;
break
;
case
NdbDictionary
:
:
Column
::
Float
:
ndbout
<<
"Float"
<<
tmp
;
break
;
case
NdbDictionary
:
:
Column
::
Double
:
ndbout
<<
"Double"
<<
tmp
;
break
;
case
NdbDictionary
:
:
Column
::
Decimal
:
ndbout
<<
"Decimal("
<<
attr
.
getScale
()
<<
", "
<<
attr
.
getPrecision
()
<<
")"
<<
tmp
;
break
;
case
NdbDictionary
:
:
Column
::
Char
:
ndbout
<<
"Char("
<<
attr
.
getLength
()
<<
")"
;
break
;
case
NdbDictionary
:
:
Column
::
Varchar
:
ndbout
<<
"Varchar("
<<
attr
.
getLength
()
<<
")"
;
break
;
case
NdbDictionary
:
:
Column
::
Binary
:
ndbout
<<
"Binary("
<<
attr
.
getLength
()
<<
")"
;
break
;
case
NdbDictionary
:
:
Column
::
Varbinary
:
ndbout
<<
"Varbinary("
<<
attr
.
getLength
()
<<
")"
;
break
;
case
NdbDictionary
:
:
Column
::
Datetime
:
ndbout
<<
"Datetime"
<<
tmp
;
break
;
case
NdbDictionary
:
:
Column
::
Timespec
:
ndbout
<<
"Timespec"
<<
tmp
;
break
;
case
NdbDictionary
:
:
Column
::
Blob
:
ndbout
<<
"Blob"
<<
tmp
;
break
;
case
NdbDictionary
:
:
Column
::
Undefined
:
ndbout
<<
"Undefined"
<<
tmp
;
ndbout
<<
"("
<<
attr
.
getScale
()
<<
", "
<<
attr
.
getPrecision
()
<<
")"
;
break
;
default:
ndbout
<<
"Unknown("
<<
type
<<
")"
;
break
;
}
ndbout
<<
" "
;
if
(
null
){
ndbout
<<
"NULL"
;
}
else
{
ndbout
<<
"
NOT
NULL"
;
}
ndbout
<<
"
"
;
if
(
attr
.
getLength
()
!=
1
)
ndbout
<<
"["
<<
attr
.
getLength
()
<<
"]"
;
if
(
attr
.
getNullable
())
ndbout
<<
" NULL"
;
else
ndbout
<<
" NOT NULL
"
;
if
(
key
)
ndbout
<<
"PRIMARY KEY"
;
if
(
attr
.
getPrimaryKey
()
)
ndbout
<<
"
PRIMARY KEY"
;
return
ndbout
;
}
...
...
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