Skip to content

Commit 8100faa

Browse files
committed
Allow xmlrow prefix
1 parent a731354 commit 8100faa

File tree

5 files changed

+21
-2
lines changed

5 files changed

+21
-2
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
*~
22
*.o
33
sql
4+
sqlx
45
sqlwrite
56
sqledit
67
sqlexpand

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,6 @@
44
[submodule "AJL"]
55
path = AJL
66
url = https://github.com/revk/AJL
7+
[submodule "AXL"]
8+
path = AXL
9+
url = https://github.com/revk/AXL

AXL

Submodule AXL added at 8970b9a

Makefile

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ ifneq ($(wildcard /usr/bin/mariadb_config),)
1010
endif
1111
OPTS=-D_GNU_SOURCE --std=gnu99 -g -Wall -funsigned-char -lpopt
1212

13-
all: sqllib.o sqllibsd.o sqlexpand.o sql sqlwrite sqledit sqlexpand
13+
all: sqllib.o sqllibsd.o sqlexpand.o sql sqlwrite sqledit sqlexpand sqlx
1414

1515
update:
1616
git pull
@@ -27,6 +27,12 @@ AJL/ajl.c:
2727
AJL/ajl.o: AJL/ajl.c AJL
2828
make -C AJL ajl.o
2929

30+
AXL/axl.c:
31+
git submodule update --init AXL
32+
33+
AXL/axl.o: AXL/axl.c AXL
34+
make -C AXL axl.o
35+
3036
sqllib.o: sqllib.c sqllib.h Makefile
3137
gcc -g -O -c -o $@ $< -fPIC ${OPTS} -DLIB ${SQLINC} -DMYSQL_VERSION=${SQLVER}
3238

@@ -36,6 +42,9 @@ sqllibsd.o: sqllib.c sqllib.h Makefile stringdecimal/stringdecimal.o
3642
sql: sql.c sqllibsd.o sqllib.h sqlexpand.o sqlexpand.h stringdecimal/stringdecimal.o AJL/ajl.o
3743
gcc -g -O -o $@ $< -fPIC ${OPTS} -DNOXML ${SQLINC} ${SQLLIB} sqllibsd.o sqlexpand.o stringdecimal/stringdecimal.o AJL/ajl.o -lcrypto -luuid -IAJL
3844

45+
sqlx: sql.c sqllibsd.o sqllib.h sqlexpand.o sqlexpand.h stringdecimal/stringdecimal.o AJL/ajl.o AXL/axl.o
46+
gcc -g -O -o $@ $< -fPIC ${OPTS} ${SQLINC} ${SQLLIB} sqllibsd.o sqlexpand.o stringdecimal/stringdecimal.o AJL/ajl.o AXL/axl.o -lcrypto -luuid -IAJL -IAXL -lcurl
47+
3948
sqlwrite: sqlwrite.c sqllibsd.o sqllib.h stringdecimal/stringdecimal.o
4049
gcc -g -O -o $@ $< -fPIC ${OPTS} ${SQLINC} ${SQLLIB} sqllibsd.o stringdecimal/stringdecimal.o
4150

sql.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,14 @@ dosql (const char *origquery)
145145
#ifndef NOJSON
146146
if (json)
147147
{
148+
j_t a = json;
149+
#ifndef NOXML
150+
if (xmlrow && *xmlrow)
151+
a = j_store_array (json, xmlrow);
152+
#endif
148153
while ((row = sql_fetch_row (res)))
149154
{
150-
j_t j = j_append_object (json);
155+
j_t j = j_append_object (a);
151156
for (f = 0; f < fields; f++)
152157
{
153158
if (!row[f])

0 commit comments

Comments
 (0)