Skip to content

Commit

Permalink
Fixed an internal bug related to MySQL bug # 12161
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian Ferrari committed May 4, 2016
1 parent a83573a commit b640c83
Show file tree
Hide file tree
Showing 12 changed files with 120 additions and 99 deletions.
6 changes: 6 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
Initial designer, architect, project manager and developer:
Christian Ferrari <tiian@users.sourceforge.net> (username=tiian)
Disclaimer:
this work has been completely performed during my spare time and
it can NOT in ANY WAY be reconducted to my professional activity.
Any possible element that can be intended in the opposite way must
be considered a coincidence.
Ch.F.
3 changes: 3 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
LOG:

20160504 - 0.9.4 fix of an internal bug related to MySQL bug # 12161
http://bugs.mysql.com/bug.php?id=12161

20160412 - 0.9.3 build procedure has been fixed for some different Linux
systems (take a look to TestLog file)
A severe bug related to MySQL wrapper has been fixed
Expand Down
1 change: 1 addition & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
SUBDIRS = etc src var tests doc ext
dist_doc_DATA = TestLog
82 changes: 66 additions & 16 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
# PARTICULAR PURPOSE.

@SET_MAKE@

VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
Expand All @@ -34,11 +35,12 @@ POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = .
DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in $(srcdir)/config.h.in \
$(srcdir)/doxygen.conf.in $(top_srcdir)/configure AUTHORS \
COPYING ChangeLog INSTALL NEWS TODO compile config.guess \
config.sub depcomp install-sh ltmain.sh missing
DIST_COMMON = README $(am__configure_deps) $(dist_doc_DATA) \
$(srcdir)/Makefile.am $(srcdir)/Makefile.in \
$(srcdir)/config.h.in $(srcdir)/doxygen.conf.in \
$(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS \
TODO compile config.guess config.sub depcomp install-sh \
ltmain.sh missing
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
$(top_srcdir)/m4include/ax_lib_oracle_oci.m4 \
Expand All @@ -65,6 +67,29 @@ RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
install-pdf-recursive install-ps-recursive install-recursive \
installcheck-recursive installdirs-recursive pdf-recursive \
ps-recursive uninstall-recursive
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
am__install_max = 40
am__nobase_strip_setup = \
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
am__nobase_strip = \
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
am__nobase_list = $(am__nobase_strip_setup); \
for p in $$list; do echo "$$p $$p"; done | \
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
if (++n[$$2] == $(am__install_max)) \
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
END { for (dir in files) print dir, files[dir] }'
am__base_list = \
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
am__installdirs = "$(DESTDIR)$(docdir)"
DATA = $(dist_doc_DATA)
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
distclean-recursive maintainer-clean-recursive
AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
Expand Down Expand Up @@ -274,6 +299,7 @@ top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
SUBDIRS = etc src var tests doc ext
dist_doc_DATA = TestLog
all: config.h
$(MAKE) $(AM_MAKEFLAGS) all-recursive

Expand Down Expand Up @@ -340,6 +366,26 @@ clean-libtool:

distclean-libtool:
-rm -f libtool config.lt
install-dist_docDATA: $(dist_doc_DATA)
@$(NORMAL_INSTALL)
test -z "$(docdir)" || $(MKDIR_P) "$(DESTDIR)$(docdir)"
@list='$(dist_doc_DATA)'; test -n "$(docdir)" || list=; \
for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
echo "$$d$$p"; \
done | $(am__base_list) | \
while read files; do \
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(docdir)'"; \
$(INSTALL_DATA) $$files "$(DESTDIR)$(docdir)" || exit $$?; \
done

uninstall-dist_docDATA:
@$(NORMAL_UNINSTALL)
@list='$(dist_doc_DATA)'; test -n "$(docdir)" || list=; \
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
test -n "$$files" || exit 0; \
echo " ( cd '$(DESTDIR)$(docdir)' && rm -f" $$files ")"; \
cd "$(DESTDIR)$(docdir)" && rm -f $$files

# This directory's subdirectories are mostly independent; you can cd
# into them and run `make' without going through this Makefile.
Expand Down Expand Up @@ -653,9 +699,12 @@ distcleancheck: distclean
exit 1; } >&2
check-am: all-am
check: check-recursive
all-am: Makefile config.h
all-am: Makefile $(DATA) config.h
installdirs: installdirs-recursive
installdirs-am:
for dir in "$(DESTDIR)$(docdir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-recursive
install-exec: install-exec-recursive
install-data: install-data-recursive
Expand Down Expand Up @@ -703,7 +752,7 @@ info: info-recursive

info-am:

install-data-am:
install-data-am: install-dist_docDATA

install-dvi: install-dvi-recursive

Expand Down Expand Up @@ -749,7 +798,7 @@ ps: ps-recursive

ps-am:

uninstall-am:
uninstall-am: uninstall-dist_docDATA

.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all \
ctags-recursive install-am install-strip tags-recursive
Expand All @@ -761,14 +810,15 @@ uninstall-am:
distcheck distclean distclean-generic distclean-hdr \
distclean-libtool distclean-tags distcleancheck distdir \
distuninstallcheck dvi dvi-am html html-am info info-am \
install install-am install-data install-data-am install-dvi \
install-dvi-am install-exec install-exec-am install-html \
install-html-am install-info install-info-am install-man \
install-pdf install-pdf-am install-ps install-ps-am \
install-strip installcheck installcheck-am installdirs \
installdirs-am maintainer-clean maintainer-clean-generic \
mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
ps ps-am tags tags-recursive uninstall uninstall-am
install install-am install-data install-data-am \
install-dist_docDATA install-dvi install-dvi-am install-exec \
install-exec-am install-html install-html-am install-info \
install-info-am install-man install-pdf install-pdf-am \
install-ps install-ps-am install-strip installcheck \
installcheck-am installdirs installdirs-am maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-generic \
mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
uninstall uninstall-am uninstall-dist_docDATA


# Tell versions [3.59,3.63) of GNU make to not export all variables.
Expand Down
6 changes: 6 additions & 0 deletions TestLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
Release: 0.9.4
Date: 2016-05-04
Configuration: --enable-crash --with-mysql --with-postgresql
Ubuntu 10.04 |x86_64 |virtual (KVM) |2 vCPU
Ubuntu 16.04 |x86_64 |virtual (KVM) |2 vCPU

Release: 0.9.3
Date: 2016-04-12
Configuration: --enable-crash --with-mysql --with-postgresql
Expand Down
20 changes: 10 additions & 10 deletions configure
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.65 for lixa 0.9.4-dev.
# Generated by GNU Autoconf 2.65 for lixa 0.9.4.
#
# Report bugs to <tiian at users dot sourceforge dot net>.
#
Expand Down Expand Up @@ -701,8 +701,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='lixa'
PACKAGE_TARNAME='lixa'
PACKAGE_VERSION='0.9.4-dev'
PACKAGE_STRING='lixa 0.9.4-dev'
PACKAGE_VERSION='0.9.4'
PACKAGE_STRING='lixa 0.9.4'
PACKAGE_BUGREPORT='tiian at users dot sourceforge dot net'
PACKAGE_URL='http://sourceforge.net/projects/lixa/'

Expand Down Expand Up @@ -1493,7 +1493,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures lixa 0.9.4-dev to adapt to many kinds of systems.
\`configure' configures lixa 0.9.4 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
Expand Down Expand Up @@ -1563,7 +1563,7 @@ fi

if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of lixa 0.9.4-dev:";;
short | recursive ) echo "Configuration of lixa 0.9.4:";;
esac
cat <<\_ACEOF
Expand Down Expand Up @@ -1691,7 +1691,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
lixa configure 0.9.4-dev
lixa configure 0.9.4
generated by GNU Autoconf 2.65
Copyright (C) 2009 Free Software Foundation, Inc.
Expand Down Expand Up @@ -2294,7 +2294,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by lixa $as_me 0.9.4-dev, which was
It was created by lixa $as_me 0.9.4, which was
generated by GNU Autoconf 2.65. Invocation command line was
$ $0 $@
Expand Down Expand Up @@ -3102,7 +3102,7 @@ fi

# Define the identity of the package.
PACKAGE='lixa'
VERSION='0.9.4-dev'
VERSION='0.9.4'


cat >>confdefs.h <<_ACEOF
Expand Down Expand Up @@ -14562,7 +14562,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by lixa $as_me 0.9.4-dev, which was
This file was extended by lixa $as_me 0.9.4, which was
generated by GNU Autoconf 2.65. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
Expand Down Expand Up @@ -14629,7 +14629,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
lixa config.status 0.9.4-dev
lixa config.status 0.9.4
configured by $0, generated by GNU Autoconf 2.65,
with options \\"\$ac_cs_config\\"
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
AC_INIT([lixa], [0.9.4-dev], [tiian at users dot sourceforge dot net], [], [http://sourceforge.net/projects/lixa/])
AC_INIT([lixa], [0.9.4], [tiian at users dot sourceforge dot net], [], [http://sourceforge.net/projects/lixa/])
AM_INIT_AUTOMAKE([-Wall -Werror])

AC_PROG_LIBTOOL
Expand Down
65 changes: 10 additions & 55 deletions doc/manuals/index.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion libtool
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#! /bin/bash

# libtool - Provide generalized library-building support services.
# Generated automatically by config.status (lixa) 0.9.4-dev
# Generated automatically by config.status (lixa) 0.9.4
# Libtool was configured on host ubuntu1004:
# NOTE: Changes made to this file will be lost: look at ltmain.sh.
#
Expand Down
4 changes: 2 additions & 2 deletions src/client/switch/mysql/liblixamy.c
Original file line number Diff line number Diff line change
Expand Up @@ -1063,7 +1063,7 @@ int lixa_my_rollback(XID *xid, int rmid, long flags)
LIXA_TRACE(("lixa_my_rollback: unable to deserialize the "
"XID retrieved with XA RECOVER\n"));
}
if (lixa_xid_compare(xid, &xid_r)) {
if (!lixa_xid_compare(xid, &xid_r)) {
LIXA_TRACE(("lixa_my_rollback: the transaction %s is in "
"prepared state\n", lmsx));
lpsr->state.S = 3;
Expand Down Expand Up @@ -1354,7 +1354,7 @@ int lixa_my_commit(XID *xid, int rmid, long flags)
LIXA_TRACE(("lixa_my_commit: unable to deserialize the "
"XID retrieved with XA RECOVER\n"));
}
if (lixa_xid_compare(xid, &xid_r)) {
if (!lixa_xid_compare(xid, &xid_r)) {
LIXA_TRACE(("lixa_my_commit: the transaction %s is in "
"prepared state\n", lmsx));
lpsr->state.S = 3;
Expand Down
16 changes: 14 additions & 2 deletions src/common/lixa_xid.c
Original file line number Diff line number Diff line change
Expand Up @@ -351,11 +351,23 @@ int lixa_xid_compare(const XID *a, const XID *b)
return -1;
else if (a->bqual_length > b->bqual_length)
return 1;
if (0 != (result = memcmp(a->data, b->data, a->gtrid_length)))
if (0 != (result = memcmp(a->data, b->data, a->gtrid_length))) {
LIXA_TRACE(("lixa_xid_compare: a->data is ",
(const byte_t *)a->data, a->gtrid_length));
LIXA_TRACE(("lixa_xid_compare: b->data is ",
(const byte_t *)b->data, a->gtrid_length));
return result;
}
if (0 != (result = memcmp(a->data + a->gtrid_length,
b->data + b->gtrid_length,
a->bqual_length)))
a->bqual_length))) {
LIXA_TRACE(("lixa_xid_compare: a->data + a->gtrid_length is ",
(const byte_t *)a->data + a->gtrid_length,
a->bqual_length));
LIXA_TRACE(("lixa_xid_compare: b->data + b->gtrid_length is ",
(const byte_t *)b->data + b->gtrid_length,
a->bqual_length));
return result;
}
return 0;
}
12 changes: 0 additions & 12 deletions tests/mysql.at
Original file line number Diff line number Diff line change
Expand Up @@ -350,15 +350,3 @@ AT_CHECK([grep '^xid=' $TESTS_TMP_FILE1 | cut -d "'" -f 2 > $TESTS_TMP_FILE2], [
AT_CHECK([export LIXA_PROFILE=CASE_PROF_0024 ; lixa_test_exec.sh noreset stop lixar -p -r -X $TESTS_TMP_FILE2], [0], [ignore], [ignore])
AT_CHECK([echo "SELECT * FROM authors;" | mysql -h localhost -u lixa lixa], [0], [ignore], [ignore])
AT_CLEANUP
#
# WARNING:
# this case test certificate there is a bug in MySQL, it does NOT certificate
# the bug is solved
# It must be executed after $TESTS_TMP_FILE1 has prepared by the previous step
#
AT_SETUP([MY/0.1/5.2 Check MySQL bug n. 12161])
AT_CHECK([if test "$LIXA_CRASH" = "no"; then exit 77; fi])
AT_CHECK([if test "$HAVE_MYSQL" = "no"; then exit 77; fi])
AT_CHECK([grep '^xid=' $TESTS_TMP_FILE1], [1], [ignore], [ignore])
AT_CHECK([echo "SELECT * FROM authors WHERE id = 9;" | mysql -h localhost -u lixa lixa|grep Surname], [1], [ignore], [ignore])
AT_CLEANUP

0 comments on commit b640c83

Please sign in to comment.