Sweede
11-24-2000, 03:31 AM
Ok, MySQL version 3.23.28 comes out, and i decide why the hell not try to get transaction support into mysql, see whats so cool about it. (also built an RPM of MySQL 3.23.28 with transaction configure lines added http://www.linuxnewbie.org/ubb/smile.gif )
So i compile the berkeleyDB from Sleepykat software, (http://www.mysql.com/Downloads/db/db-3.2.3c.tar.gz). which by the way, was sooo hard.
tar -zxvf db-3.2.3c.tar.gz
cd [dir]/dist
./configure
make
make install
heh,
this installs the db stuff into /usr/local/berkeleyDB.3.2
which is all good,
Now you can go get my SRC rpm (link will be up shortly, so be paiteint), and it will install just like the normal RPMS, but have BerkeleyDB support with it.
and as long as it makes it through the compile, it'll be just fine.
start mysql up and all that, do the normal gig, but here's the catch.
for MySQL transactions to work, you have to define the table as a BDB table.
CREATE TABLE tablename(
id int(5) NOT NULL auto_increment,
name varchar(25) NOT NULL,
email varchar(25) NOT NULL,
PRIMARY KEY (id),
KEY id (id)
)
TYPE=BDB
;
And thats it !!!
an example...
mysql>begin;
mysql> select * from tablename;
Empty set (0.00 sec)
mysql> INSERT INTO tablename (name,email) VALUES ('Sweede','sweede@underthemain
.net')
-> ;
Query OK, 1 row affected (0.00 sec)
mysql> select * from tablename;
+----+--------+-------------------------+
| id | name | email |
+----+--------+-------------------------+
| 1 | Sweede | sweede@underthemain.net |
+----+--------+-------------------------+
1 row in set (0.00 sec)
mysql> rollback;
Query OK, 0 rows affected (0.00 sec)
mysql> select * from tablename;
Empty set (0.00 sec)
mysql> INSERT INTO tablename (name,email) VALUES ('Sweede','sweede@underthemain
.net');
Query OK, 1 row affected (0.01 sec)
mysql> commit;
Query OK, 0 rows affected (0.00 sec)
mysql> select * from tablename;
+----+--------+-------------------------+
| id | name | email |
+----+--------+-------------------------+
| 1 | Sweede | sweede@underthemain.net |
+----+--------+-------------------------+
1 row in set (0.00 sec)
mysql>
Simple as that !!
for anyone who wanted to do this but was to [insert expression here]
you can get my modified RPMS at
ftp://ftp.underthemain.net/pub/MySQL
SRPM included causs that wouldnt be very GPL like. http://www.linuxnewbie.org/ubb/smile.gif
So i compile the berkeleyDB from Sleepykat software, (http://www.mysql.com/Downloads/db/db-3.2.3c.tar.gz). which by the way, was sooo hard.
tar -zxvf db-3.2.3c.tar.gz
cd [dir]/dist
./configure
make
make install
heh,
this installs the db stuff into /usr/local/berkeleyDB.3.2
which is all good,
Now you can go get my SRC rpm (link will be up shortly, so be paiteint), and it will install just like the normal RPMS, but have BerkeleyDB support with it.
and as long as it makes it through the compile, it'll be just fine.
start mysql up and all that, do the normal gig, but here's the catch.
for MySQL transactions to work, you have to define the table as a BDB table.
CREATE TABLE tablename(
id int(5) NOT NULL auto_increment,
name varchar(25) NOT NULL,
email varchar(25) NOT NULL,
PRIMARY KEY (id),
KEY id (id)
)
TYPE=BDB
;
And thats it !!!
an example...
mysql>begin;
mysql> select * from tablename;
Empty set (0.00 sec)
mysql> INSERT INTO tablename (name,email) VALUES ('Sweede','sweede@underthemain
.net')
-> ;
Query OK, 1 row affected (0.00 sec)
mysql> select * from tablename;
+----+--------+-------------------------+
| id | name | email |
+----+--------+-------------------------+
| 1 | Sweede | sweede@underthemain.net |
+----+--------+-------------------------+
1 row in set (0.00 sec)
mysql> rollback;
Query OK, 0 rows affected (0.00 sec)
mysql> select * from tablename;
Empty set (0.00 sec)
mysql> INSERT INTO tablename (name,email) VALUES ('Sweede','sweede@underthemain
.net');
Query OK, 1 row affected (0.01 sec)
mysql> commit;
Query OK, 0 rows affected (0.00 sec)
mysql> select * from tablename;
+----+--------+-------------------------+
| id | name | email |
+----+--------+-------------------------+
| 1 | Sweede | sweede@underthemain.net |
+----+--------+-------------------------+
1 row in set (0.00 sec)
mysql>
Simple as that !!
for anyone who wanted to do this but was to [insert expression here]
you can get my modified RPMS at
ftp://ftp.underthemain.net/pub/MySQL
SRPM included causs that wouldnt be very GPL like. http://www.linuxnewbie.org/ubb/smile.gif