Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
5cbb6631
Kaydet (Commit)
5cbb6631
authored
Mar 04, 2016
tarafından
Lionel Elie Mamane
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
pgsql-sdbc: factorise common code
Change-Id: Iea185bc216e92baee9f97157b8ac13a9a64f99b5
üst
0b0c99ed
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
54 deletions
+38
-54
pq_databasemetadata.cxx
...ctivity/source/drivers/postgresql/pq_databasemetadata.cxx
+38
-54
No files found.
connectivity/source/drivers/postgresql/pq_databasemetadata.cxx
Dosyayı görüntüle @
5cbb6631
...
...
@@ -1209,41 +1209,56 @@ sal_Bool DatabaseMetaData::dataDefinitionIgnoredInTransactions( ) throw (SQLExc
m_refMutex
,
*
this
,
statics
.
tablesRowNames
,
vec
,
m_pSettings
->
tc
);
}
struct
SortInternalSchemasLastAndPublicFirst
namespace
{
bool
operator
()
(
const
std
::
vector
<
Any
>
&
a
,
const
std
::
vector
<
Any
>
&
b
)
// sort no schema first, then "public", then normal schemas, then internal schemas
int
compare_schema
(
const
OUString
&
nsA
,
const
OUString
&
nsB
)
{
OUString
valueA
;
OUString
valueB
;
a
[
0
]
>>=
valueA
;
b
[
0
]
>>=
valueB
;
bool
ret
=
false
;
if
(
valueA
==
"public"
)
if
(
nsA
.
isEmpty
())
{
ret
=
true
;
ret
urn
nsB
.
isEmpty
()
?
0
:
-
1
;
}
else
if
(
valueB
==
"public"
)
else
if
(
nsB
.
isEmpty
()
)
{
ret
=
false
;
assert
(
!
nsA
.
isEmpty
());
return
1
;
}
else
if
(
valueA
.
startsWith
(
"pg_"
)
&&
valueB
.
startsWith
(
"pg_"
)
)
else
if
(
nsA
==
"public"
)
{
ret
=
valueA
.
compareTo
(
valueB
)
<
0
;
// sorts equal !
ret
urn
(
nsB
==
"public"
)
?
0
:
-
1
;
}
else
if
(
valueA
.
startsWith
(
"pg_"
)
)
else
if
(
nsB
==
"public"
)
{
ret
=
false
;
// sorts last !
assert
(
nsA
!=
"public"
);
return
1
;
}
else
if
(
valueB
.
startsWith
(
"pg_"
)
)
else
if
(
nsA
.
startsWith
(
"pg_"
)
)
{
ret
=
true
;
// sorts first !
if
(
nsB
.
startsWith
(
"pg_"
))
return
nsA
.
compareTo
(
nsB
);
else
return
1
;
}
else
if
(
nsB
.
startsWith
(
"pg_"
))
{
return
-
1
;
}
else
{
ret
=
(
valueA
.
compareTo
(
valueB
)
<
0
);
ret
urn
nsA
.
compareTo
(
nsB
);
}
return
ret
;
}
}
struct
SortInternalSchemasLastAndPublicFirst
{
bool
operator
()
(
const
std
::
vector
<
Any
>
&
a
,
const
std
::
vector
<
Any
>
&
b
)
{
OUString
valueA
;
OUString
valueB
;
a
[
0
]
>>=
valueA
;
b
[
0
]
>>=
valueB
;
return
compare_schema
(
valueA
,
valueB
);
}
};
...
...
@@ -2171,8 +2186,8 @@ struct TypeInfoByDataTypeSorter
assert
(
nIndex
<
0
);
}
// sort no schema first, then "public", then normal schemas, then internal schemas
if
(
ns
A
==
nsB
)
const
int
ns_comp
=
compare_schema
(
nsA
,
nsB
);
if
(
ns
_comp
==
0
)
{
if
(
nsA
.
isEmpty
())
{
...
...
@@ -2185,40 +2200,9 @@ struct TypeInfoByDataTypeSorter
}
return
nameA
.
compareTo
(
nameB
)
<
0
;
}
else
if
(
nsA
.
isEmpty
())
{
assert
(
!
nsB
.
isEmpty
());
return
true
;
}
else
if
(
nsB
.
isEmpty
())
{
assert
(
!
nsA
.
isEmpty
());
return
false
;
}
else
if
(
nsA
==
"public"
)
{
assert
(
nsB
!=
"public"
);
return
true
;
}
else
if
(
nsB
==
"public"
)
{
assert
(
nsA
!=
"public"
);
return
false
;
}
else
if
(
nsA
.
startsWith
(
"pg_"
))
{
if
(
nsB
.
startsWith
(
"pg_"
))
return
nsA
.
compareTo
(
nsB
)
<
0
;
else
return
false
;
}
else
if
(
nsB
.
startsWith
(
"pg_"
))
{
return
true
;
}
else
{
return
ns
A
.
compareTo
(
nsB
)
<
0
;
return
ns
_comp
<
0
;
}
}
...
...
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