*Editor's note: This story has been updated to add information about U.S. Supreme Court precedent.

Any candidate seeking elected office in Texas would be required to take a drug test when he or she files to run, under a proposal that the state Senate approved Tuesday. But the idea may never take effect, since a U.S. Supreme Court ruling overturned a similar law in the 1990s.

There wouldn’t be any consequences for failing the test under the rule, which was included as an amendment on far-reaching ethics legislation. But the results would be posted on the Texas Ethics Commission’s website.

The Senate approved the ethics measure, Senate Bill 19, with a 30-1 vote after an hours-long debate. The amendment with the drug testing rule was approved 22-9. The measure now goes to the House.

Sen. Eddie Lucio Jr., D-Brownsville, who was behind the amendment, has supported drug testing for candidates for years. He introduced a bill with that goal in 2013, and even took a drug test of his own before it was considered in a committee hearing. The bill was approved by the committee, but never reached the Senate floor.

Lucio filed a similar bill this year, but it hasn’t received a committee hearing. He offered the idea as an amendment to give it another chance. He said he was pleased that it passed.

“Last session, this was called a silly bill,” he said. “That really hurt me.”

The amendment would apply to more than just legislators. Anyone seeking public office – candidates for city council, school board or even governor – would have to take the test. The candidate would be responsible for paying for it, and would choose what kind of test to take.

The amendment could still be stripped when the House takes up the measure. But Lucio said he hopes it becomes law. Being drug-free is especially important in Texas, he said, because the state is a major drug corridor in the United States.

“I think whoever serves should have a clear mind,” he said.

Debate over the rule was brief, and didn’t address possible legal challenges. In 1997, the U.S. Supreme Court overturned a Georgia law requiring drug tests for candidates for state office. The court ruled that the law violated the Fourth Amendment, which protects against unreasonable search and seizure.

Lucio’s proposal has some small differences. In Georgia, the law required that the candidate pass the test in order to appear on the ballot. A failed drug test in Texas wouldn’t prevent anyone from running. But the Supreme Court ruled that the Georgia law violated candidates’ privacy, so those distinctions might not matter.