parent
ef26c52c67
commit
f6aedf345a
@ -0,0 +1,54 @@
|
|||||||
|
From 1fa475684275fb7fb089b2fc84a843d2d16068f0 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Kenichi Ishigaki <ishigaki@cpan.org>
|
||||||
|
Date: Sat, 26 Feb 2022 11:20:41 +0900
|
||||||
|
Subject: [PATCH] Lowercase datatype
|
||||||
|
MIME-Version: 1.0
|
||||||
|
Content-Type: text/plain; charset=UTF-8
|
||||||
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
||||||
|
Petr Písař: Ported to 1.70 from
|
||||||
|
abc241d7114e3fdf8a2336aef96e290ec6b59a75.
|
||||||
|
|
||||||
|
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
||||||
|
---
|
||||||
|
dbdimp.c | 17 ++++++++++++++++-
|
||||||
|
1 file changed, 16 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/dbdimp.c b/dbdimp.c
|
||||||
|
index ca89c7c..c38600f 100644
|
||||||
|
--- a/dbdimp.c
|
||||||
|
+++ b/dbdimp.c
|
||||||
|
@@ -1924,6 +1924,21 @@ sqlite_db_load_extension(pTHX_ SV *dbh, const char *file, const char *proc)
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
+SV* _lc(SV* sv) {
|
||||||
|
+ int i, l;
|
||||||
|
+ char* pv;
|
||||||
|
+ if (SvPOK(sv)) {
|
||||||
|
+ pv = SvPV_nolen(sv);
|
||||||
|
+ l = strlen(pv);
|
||||||
|
+ for(i = 0; i < l; i++) {
|
||||||
|
+ if (pv[i] >= 'A' && pv[i] <= 'Z') {
|
||||||
|
+ pv[i] = pv[i] - 'A' + 'a';
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+ return sv;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
HV*
|
||||||
|
sqlite_db_table_column_metadata(pTHX_ SV *dbh, SV *dbname, SV *tablename, SV *columnname)
|
||||||
|
{
|
||||||
|
@@ -1960,7 +1975,7 @@ sqlite_db_table_column_metadata(pTHX_ SV *dbh, SV *dbname, SV *tablename, SV *co
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if (rc == SQLITE_OK) {
|
||||||
|
- hv_stores(metadata, "data_type", datatype ? newSVpv(datatype, 0) : newSV(0));
|
||||||
|
+ hv_stores(metadata, "data_type", datatype ? _lc(newSVpv(datatype, 0)) : newSV(0));
|
||||||
|
hv_stores(metadata, "collation_name", collseq ? newSVpv(collseq, 0) : newSV(0));
|
||||||
|
hv_stores(metadata, "not_null", newSViv(notnull));
|
||||||
|
hv_stores(metadata, "primary", newSViv(primary));
|
||||||
|
--
|
||||||
|
2.34.1
|
||||||
|
|
@ -0,0 +1,38 @@
|
|||||||
|
From b6a4eb43a7ae3e5e6edaf347f91520853f727a24 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Kenichi Ishigaki <ishigaki@cpan.org>
|
||||||
|
Date: Sat, 26 Feb 2022 11:28:39 +0900
|
||||||
|
Subject: [PATCH 2/2] THX
|
||||||
|
MIME-Version: 1.0
|
||||||
|
Content-Type: text/plain; charset=UTF-8
|
||||||
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
||||||
|
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
||||||
|
---
|
||||||
|
dbdimp.c | 4 ++--
|
||||||
|
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/dbdimp.c b/dbdimp.c
|
||||||
|
index 95232b7..2c5b32d 100644
|
||||||
|
--- a/dbdimp.c
|
||||||
|
+++ b/dbdimp.c
|
||||||
|
@@ -1928,7 +1928,7 @@ sqlite_db_load_extension(pTHX_ SV *dbh, const char *file, const char *proc)
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
-SV* _lc(SV* sv) {
|
||||||
|
+SV* _lc(pTHX_ SV* sv) {
|
||||||
|
int i, l;
|
||||||
|
char* pv;
|
||||||
|
if (SvPOK(sv)) {
|
||||||
|
@@ -1979,7 +1979,7 @@ sqlite_db_table_column_metadata(pTHX_ SV *dbh, SV *dbname, SV *tablename, SV *co
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if (rc == SQLITE_OK) {
|
||||||
|
- hv_stores(metadata, "data_type", datatype ? _lc(newSVpv(datatype, 0)) : newSV(0));
|
||||||
|
+ hv_stores(metadata, "data_type", datatype ? _lc(aTHX_ newSVpv(datatype, 0)) : newSV(0));
|
||||||
|
hv_stores(metadata, "collation_name", collseq ? newSVpv(collseq, 0) : newSV(0));
|
||||||
|
hv_stores(metadata, "not_null", newSViv(notnull));
|
||||||
|
hv_stores(metadata, "primary", newSViv(primary));
|
||||||
|
--
|
||||||
|
2.34.1
|
||||||
|
|
Loading…
Reference in new issue