PDA

View Full Version : Undoing Queries


dieselpowered
07-31-2005, 06:06 AM
Hi there everyone...Alright I am going to be doing some changed on my site and would like to remove some hacks. Some of the hacks have altered the tables in the db (see below for example)

ALTER TABLE user ADD INDEX (lastactivity)

How do I go about reversing what was changed?

Thanks everyone for the help!

Marco van Herwaarden
07-31-2005, 10:12 AM
in this case it would be:
ALTER TABLE user DROP INDEX (lastactivity);
But the reverse will vary with each statement.

dieselpowered
07-31-2005, 11:41 PM
Thank you very much...so 'ADD' would be 'DROP' what are some of the others?

in this case it would be:
ALTER TABLE user DROP INDEX (lastactivity);
But the reverse will vary with each statement.

Alright I am confused...I get an SQL error when I try to run that.

Marco van Herwaarden
08-01-2005, 03:42 AM
What is the error you get?

dieselpowered
08-01-2005, 03:50 AM
I am getting a syntax error....I cannot duplicate it right now, but it basically says I have something wrong with my SQL syntax??

Marco van Herwaarden
08-01-2005, 04:00 AM
Well it is difficult to help without the full error.

dieselpowered
08-01-2005, 04:01 AM
I understand...I am sure I will get it as soon as I attempt another one...I will report back. Hey, with that said, do you know the answer to this:

Currently I am running VB 3.0.3 and my server is running 4.1.13 for SQL.

Previously I had a server that was running SQL 4.1.9 it it jacked up my attachments and avatars.

My question is, have they fixed the collation bug in 4.1.13? Can I backup that database without issues or do I have to run those queries first?

Thanks!

Marco van Herwaarden
08-01-2005, 04:05 AM
Define 'Those queries', are you talking about the changes posted at vb.com?

And to answer: yes on 3.5 and 3.0.8 the workaround for the MySQL bug is done.

dieselpowered
08-01-2005, 04:35 AM
I understand what you are saying. What I wanted to do is make a backup of my curent forums which are 3.0.3 do I need to run those queries from vb.com or will I be ok since I am using sql 4.1.13?

Marco van Herwaarden
08-01-2005, 06:16 AM
Since you are running MySQL 4.1, you should run them before making a backup if your board is not on 3.0.8 or 3.5.

PS This assuming that we talk about the same queries from vb.com.

dieselpowered
08-02-2005, 12:32 AM
I there, alright yes I had to run those queries.

Also here is that error from what we were originally talking about.

I ran the query:

ALTER TABLE user DROP INDEX (lastactivity);

and received the error attached below?? It will let me run the query to add, but not drop??

Marco van Herwaarden
08-02-2005, 03:40 AM
Ahh remove the () from that line.

dieselpowered
08-02-2005, 03:43 AM
That is odd....so when adding you need the () and when dropping you do not?

Appreciate the help!